Edit report at https://bugs.php.net/bug.php?id=62989&edit=1
ID: 62989
Comment by: gmblar+php at gmail dot com
Reported by: gmblar+php at gmail dot com
Summary: recursive __call cause segfault
Status: Not a bug
Type: Bug
Package: Class/Object related
Operating System: MacOSX
PHP Version: 5.4.6
Block user comment: N
Private report: N
New Comment:
I expect the same from __call as from a normal method which abort with a fatal
error.
<?php
class foo {
public function bar() {
$this->bar();
}
}
$foo = new foo();
$foo->bar();
PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to
allocate 130968 bytes) in - on line 5
Previous Comments:
------------------------------------------------------------------------
[2012-09-01 14:45:17] [email protected]
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php
It's expected, due the call stack overflow.
------------------------------------------------------------------------
[2012-09-01 12:42:36] gmblar+php at gmail dot com
Description:
------------
recursive __call cause segfault
Test script:
---------------
<?php
class foo {
public function __call($method, $arguments) {
$this->bar();
}
}
$foo = new foo();
$foo->bar();
Expected result:
----------------
PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to
allocate 130968 bytes) in - on line 6
Actual result:
--------------
Segmentation fault: 11
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=62989&edit=1