OOP: Constructors and destructors does not obey to access modifiers #4
Loading…
Reference in New Issue
There is no content yet.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may exist for a short time before cleaning up, in most cases it CANNOT be undone. Continue?
Aer Information
e53cfb8ba0
Your problem description
__construct() and __destruct() are always considered to be public by PH7 Engine and this is wrong behaviour. There should be no exception in the matter of how access modifiers are working.
Above example shows that when calling private __toString method from constructor it is working, but call from outside class is omitted, as expected. Anyway constructor is still called, despite it is private.
Expected results
// No output at all
Current results
I live, again!
STRING
This is fixed by
408ccc73c2
.