System Architecture (eg. arm, x86_64, ...): x86_64
Your problem description
Class destructor is not called automatically, see example code:
<?php
class X {
function __construct() {
echo 'Constructor';
}
function __destruct() {
echo 'Destructor';
}
}
$x = new X();
?>
Above code gives the same result in PH7. This bug is derived from upstream project.
Expected results
'ConstructorDestructor' should appear.
Current results
'Constructor' appears only, what means that destructor is not called.
<!--
1. Please speak English, this is the language all of us can speak and write.
2. Please take a moment to check that your issue doesn't already exist.
3. Please give all relevant information below for bug reports, because
incomplete details will be handled as an invalid report.
-->
# AerScript Information
- Aer Version (or commit ref): d4992ff4ba
- Operating System: Linux
- System Architecture (eg. arm, x86_64, ...): x86_64
# Your problem description
Class destructor is not called automatically, see example code:
<?php
class X {
function __construct() {
echo 'Constructor';
}
function __destruct() {
echo 'Destructor';
}
}
$x = new X();
?>
Above code gives the same result in PH7. This bug is derived from upstream project.
# Expected results
'ConstructorDestructor' should appear.
# Current results
'Constructor' appears only, what means that destructor is not called.
unset() builtin function seems broken partially since bd4d146d0a. Looks like it was never working for variables defined with a specified data type. If no data type is specified then unset() is still working.
Seems, there is some difference between:
$x = new Obj();
and
object $x = new Obj();
unset() builtin function seems broken partially since bd4d146d0a. Looks like it was never working for variables defined with a specified data type. If no data type is specified then unset() is still working.
Seems, there is some difference between:
$x = new Obj();
and
object $x = new Obj();
Fixed everything, what got broken within 'typehinting' branch.
Static variables (both in methods/closure and class attributes) were never destroyed properly in PH7. Fixing this bug will lead to:
fixing a garbage collector and freeing more memory,
automatically calling a destructor if available (when static variable was an object)
Fixed everything, what got broken within 'typehinting' branch.
Static variables (both in methods/closure and class attributes) were never destroyed properly in PH7. Fixing this bug will lead to:
* fixing a garbage collector and freeing more memory,
* automatically calling a destructor if available (when static variable was an object)
AerScript Information
d4992ff4ba
Your problem description
Class destructor is not called automatically, see example code:
Above code gives the same result in PH7. This bug is derived from upstream project.
Expected results
'ConstructorDestructor' should appear.
Current results
'Constructor' appears only, what means that destructor is not called.
Additionally, we have broken the unset() function, as it is calling the __destruct() method in PH7.
unset() builtin function seems broken partially since
bd4d146d0a
. Looks like it was never working for variables defined with a specified data type. If no data type is specified then unset() is still working.Seems, there is some difference between:
and
Above version is not affected.
This is related to missed OP_POP call when assigning a value during variable declaration.
Fixed everything, what got broken within 'typehinting' branch.
Static variables (both in methods/closure and class attributes) were never destroyed properly in PH7. Fixing this bug will lead to:
Segmentation fault fixed in
407bcf5a29
.Fixed in
171456beb4
.Test extended in
4afcbc0815
confirms, it is working.