Class destructor is not called automatically #47
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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.