I believe this is essentially infinite recursion caused by the way PHP resolves methods..
the test case basically does this
create a new Test_PHP5 object, named $this
call $this->__construct()
$this->__construct calls parent::Test(), which leaves $this as a Test_PHP5, and maps to Test::Test()
Test::Test() calls $this->__construct(), which is mapped to Test_PHP5::__construct()
$this->__construct() calls parent::Test() which maps to Test::Test()
... infinite recursion
This would cause issues with any PHP interpreter. On Maverick though, this is the result:
As you can see, Test::__construct() is never called.
When I run your test script on lucid with the latest updates, it actually just sits there and doesn't return anything, nor does it segfault.
As far as I know, you can't really access overriden methods from the parent itself, you have to call parent::methodname from the overriding method to get to that old code. Given the situation above, the right way to solve this problem is not to call parent::Test(), but parent::__construct().
I'm going to close this report as invalid, but please feel free to re-open it (set it to New) if you feel that I have misunderstood the intent of the test case or if you have a different test case that shows the crash without overloading the stack.
Vladimir, thanks very much for this bug report!
I believe this is essentially infinite recursion caused by the way PHP resolves methods..
the test case basically does this
create a new Test_PHP5 object, named $this __construct( ) __construct( ), which is mapped to Test_PHP5: :__construct( ) __construct( ) calls parent::Test() which maps to Test::Test()
call $this->
$this->__construct calls parent::Test(), which leaves $this as a Test_PHP5, and maps to Test::Test()
Test::Test() calls $this->
$this->
... infinite recursion
This would cause issues with any PHP interpreter. On Maverick though, this is the result:
PHP Fatal error: Maximum function nesting level of '100' reached, aborting! in /home/clint/ test.php on line 7 test.php: 0 >__construct( ) /home/clint/ test.php: 26 test.php: 22 >__construct( ) /home/clint/ test.php: 7 test.php: 22 >__construct( ) /home/clint/ test.php: 7 test.php: 22 >__construct( ) /home/clint/ test.php: 7 test.php: 22 >__construct( ) /home/clint/ test.php: 7 test.php: 22 >__construct( ) /home/clint/ test.php: 7 test.php: 22 >__construct( ) /home/clint/ test.php: 7 test.php: 22 >__construct( ) /home/clint/ test.php: 7 test.php: 22 >__construct( ) /home/clint/ test.php: 7 test.php: 22 >__construct( ) /home/clint/ test.php: 7 test.php: 22 >__construct( ) /home/clint/ test.php: 7 test.php: 22 >__construct( ) /home/clint/ test.php: 7 test.php: 22 >__construct( ) /home/clint/ test.php: 7 test.php: 22 >__construct( ) /home/clint/ test.php: 7 test.php: 22 >__construct( ) /home/clint/ test.php: 7 test.php: 22 >__construct( ) /home/clint/ test.php: 7 test.php: 22 >__construct( ) /home/clint/ test.php: 7 test.php: 22 >__construct( ) /home/clint/ test.php: 7 test.php: 22 >__construct( ) /home/clint/ test.php: 7 test.php: 22 >__construct( ) /home/clint/ test.php: 7 test.php: 22 >__construct( ) /home/clint/ test.php: 7 test.php: 22 >__construct( ) /home/clint/ test.php: 7 test.php: 22 >__construct( ) /home/clint/ test.php: 7 test.php: 22 >__construct( ) /home/clint/ test.php: 7 test.php: 22 >__construct( ) /home/clint/ test.php: 7 test.php: 22 >__construct( ) /home/clint/ test.php: 7 test.php: 22 >__construct( ) /home/clint/ test.php: 7 test.php: 22 >__construct( ) /home/clint/ test.php: 7 test.php: 22 >__construct( ) /home/clint/ test.php: 7 test.php: 22 >__construct( ) /home/clint/ test.php: 7 test.php: 22 >__construct( ) /home/clint/ test.php: 7 test.php: 22 >__construct( ) /home/clint/ test.php: 7 test.php: 22 >__construct( ) /home/clint/ test.php: 7 test.php: 22 >__construct( ) /home/clint/ test.php: 7 test.php: 22 >__construct( ) /home/clint/ test.php: 7 test.php: 22 >__construct( ) /home/clint/ test.php: 7 test.php: 22 >__construct( ) /home/clint/ test.php: 7 test.php: 22 >__construct( ) /home/clint/ test.php: 7 test.php: 22 >__construct( ) /home/clint/ test.php: 7 test.php: 22 >__construct( ) /home/clint/ test.php: 7 test.php: 22 >__construct( ) /home/clint/ test.php: 7 test.php: 22 >__construct( ) /home/clint/ test.php: 7 test.php: 22 >__construct( ) /home/clint/ test.php: 7 test.php: 22 >__construct( ) /home/clint/ test.php: 7 test.php: 22 >__construct( ) /home/clint/ test.php: 7 test.php: 22 >__construct( ) /home/clint/ test.php: 7 test.php: 22 >__construct( ) /home/clint/ test.php: 7 test.php: 22 >__construct( ) /home/clint/ test.php: 7 test.php: 22 >__construct( ) /home/clint/ test.php: 7 test.php: 22
PHP Stack trace:
PHP 1. {main}() /home/clint/
PHP 2. Test_PHP5-
PHP 3. Test->Test() /home/clint/
PHP 4. Test_PHP5-
PHP 5. Test->Test() /home/clint/
PHP 6. Test_PHP5-
PHP 7. Test->Test() /home/clint/
PHP 8. Test_PHP5-
PHP 9. Test->Test() /home/clint/
PHP 10. Test_PHP5-
PHP 11. Test->Test() /home/clint/
PHP 12. Test_PHP5-
PHP 13. Test->Test() /home/clint/
PHP 14. Test_PHP5-
PHP 15. Test->Test() /home/clint/
PHP 16. Test_PHP5-
PHP 17. Test->Test() /home/clint/
PHP 18. Test_PHP5-
PHP 19. Test->Test() /home/clint/
PHP 20. Test_PHP5-
PHP 21. Test->Test() /home/clint/
PHP 22. Test_PHP5-
PHP 23. Test->Test() /home/clint/
PHP 24. Test_PHP5-
PHP 25. Test->Test() /home/clint/
PHP 26. Test_PHP5-
PHP 27. Test->Test() /home/clint/
PHP 28. Test_PHP5-
PHP 29. Test->Test() /home/clint/
PHP 30. Test_PHP5-
PHP 31. Test->Test() /home/clint/
PHP 32. Test_PHP5-
PHP 33. Test->Test() /home/clint/
PHP 34. Test_PHP5-
PHP 35. Test->Test() /home/clint/
PHP 36. Test_PHP5-
PHP 37. Test->Test() /home/clint/
PHP 38. Test_PHP5-
PHP 39. Test->Test() /home/clint/
PHP 40. Test_PHP5-
PHP 41. Test->Test() /home/clint/
PHP 42. Test_PHP5-
PHP 43. Test->Test() /home/clint/
PHP 44. Test_PHP5-
PHP 45. Test->Test() /home/clint/
PHP 46. Test_PHP5-
PHP 47. Test->Test() /home/clint/
PHP 48. Test_PHP5-
PHP 49. Test->Test() /home/clint/
PHP 50. Test_PHP5-
PHP 51. Test->Test() /home/clint/
PHP 52. Test_PHP5-
PHP 53. Test->Test() /home/clint/
PHP 54. Test_PHP5-
PHP 55. Test->Test() /home/clint/
PHP 56. Test_PHP5-
PHP 57. Test->Test() /home/clint/
PHP 58. Test_PHP5-
PHP 59. Test->Test() /home/clint/
PHP 60. Test_PHP5-
PHP 61. Test->Test() /home/clint/
PHP 62. Test_PHP5-
PHP 63. Test->Test() /home/clint/
PHP 64. Test_PHP5-
PHP 65. Test->Test() /home/clint/
PHP 66. Test_PHP5-
PHP 67. Test->Test() /home/clint/
PHP 68. Test_PHP5-
PHP 69. Test->Test() /home/clint/
PHP 70. Test_PHP5-
PHP 71. Test->Test() /home/clint/
PHP 72. Test_PHP5-
PHP 73. Test->Test() /home/clint/
PHP 74. Test_PHP5-
PHP 75. Test->Test() /home/clint/
PHP 76. Test_PHP5-
PHP 77. Test->Test() /home/clint/
PHP 78. Test_PHP5-
PHP 79. Test->Test() /home/clint/
PHP 80. Test_PHP5-
PHP 81. Test->Test() /home/clint/
PHP 82. Test_PHP5-
PHP 83. Test->Test() /home/clint/
PHP 84. Test_PHP5-
PHP 85. Test->Test() /home/clint/
PHP 86. Test_PHP5-
PHP 87. Test->Test() /home/clint/
PHP 88. Test_PHP5-
PHP 89. Test->Test() /home/clint/
PHP 90. Test_PHP5-
PHP 91. Test->Test() /home/clint/
PHP 92. Test_PHP5-
PHP 93. Test->Test() /home/clint/
PHP 94. Test_PHP5-
PHP 95. Test->Test() /home/clint/
PHP 96. Test_PHP5-
PHP 97. Test->Test() /home/clint/
PHP 98. Test_PHP5-
PHP 99. Test->Test() /home/clint/
As you can see, Test::__construct() is never called.
When I run your test script on lucid with the latest updates, it actually just sits there and doesn't return anything, nor does it segfault.
As far as I know, you can't really access overriden methods from the parent itself, you have to call parent::methodname from the overriding method to get to that old code. Given the situation above, the right way to solve this problem is not to call parent::Test(), but parent: :__construct( ).
I'm going to close this report as invalid, but please feel free to re-open it (set it to New) if you feel that I have misunderstood the intent of the test case or if you have a different test case that shows the crash without overloading the stack.