Bug #73713 [Fbk->NoF]: Static var in class func initialized after same func of parent class is called
Edit report at https://bugs.php.net/bug.php?id=73713&edit=1
ID: 73713
Updated by: php-bugs@lists.php.net
Reported by: thomas at beamstyle dot com dot hk
Summary: Static var in class func initialized after same func
of parent class is called
-Status: Feedback
+Status: No Feedback
Type: Bug
Package: Class/Object related
Operating System: Windows
PHP Version: 5.6.25
Private report: N
New Comment:
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.
Previous Comments:
------------------------------------------------------------------------
[2020-06-25 08:07:49] nikic@php.net
It looks like the script.txt is no longer available, so it's no longer possible to understand
what this bug report was about :(
------------------------------------------------------------------------
[2016-12-20 04:34:46] thomas at beamstyle dot com dot hk
Hello there, doesn't seem so active here. Does anyone happy to see this issue?
------------------------------------------------------------------------
[2016-12-10 18:46:46] thomas at beamstyle dot com dot hk
PHP version typo
------------------------------------------------------------------------
[2016-12-10 18:45:40] thomas at beamstyle dot com dot hk
Description:
------------
-----
When all 3 classes are in one file, everything works fine, and Test Script A (main) gives expected
output.
However, when you separate the classes into 3 files and using autoloading (PSR-4 via composer, but
probably doesn't matter what standard we use), this fails...
-----
Also, one more interesting fact is if you try Test Script B (on the side), It seems to work as
expected, though it should not make any difference based on my class declaration.
Test script:
---------------
Class declaration:
http://beamstyle.com.hk/download/script.txt
Test Script A (Main):
\Namespace2\B::test() . '<br>';
\Namespace2\C::test() . '<br>';
\Namespace2\B::test() . '<br>';
\Namespace2\C::test() . '<br>';
Test Script B (On the side):
\Namespace2\C::test() . '<br>';
\Namespace2\B::test() . '<br>';
\Namespace2\C::test() . '<br>';
\Namespace2\B::test() . '<br>';
Expected result:
----------------
$var===null for the class: Namespace2\B
$var===null for the class: Namespace2\C
$var!==null for the class: Namespace2\B
$var!==null for the class: Namespace2\C
Actual result:
--------------
$var===null for the class: Namespace2\B
$var!==null for the class: Namespace2\C
$var!==null for the class: Namespace2\B
$var!==null for the class: Namespace2\C
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=73713&edit=1
Thread (5 messages)