From: tom at tomwardrop dot com
Operating system: Windows 7 x64
PHP version: 5.3.1
PHP Bug Type: Reproducible crash
Bug description: Crash When Calling Parent Constructor with call_user_func()
Description:
------------
If class B, extends Class A, and class B calls Class A's constructor in
its own contructor by using call_user_func("parent", "__construct"), and if
class A's constructor is defined as the class name rather than
"__construct", then PHP seems to crash (which results in Apache 2
crashing). Problem still exists with all extensions disabled.
Reproduce code:
---------------
<?php
class testClass
{
function testClass ()
{
echo 'Output string!';
}
}
class testClass2 extends testClass
{
function __construct ()
{
call_user_func(array('parent', '__construct'));
}
}
new testClass2;
?>
Expected result:
----------------
The above code should echo out the string 'Output string!'. This code
works correctly when "call_user_func" or "call_user_func_array" are not
used.
Actual result:
--------------
call_user_func() and call_user_func_array(), cause PHP and as a result,
Apache 2 to crash. When running PHP DBG debugger, the crash happens on the
execution of call_user_func() line. The Windows event log notes that
httpd.exe (apache) had crashed, blaming php5ts.dll for the fault.
--
Edit bug report at http://bugs.php.net/?id=50261&edit=1
--
Try a snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=50261&r=trysnapshot52
Try a snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=50261&r=trysnapshot53
Try a snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=50261&r=trysnapshot60
Fixed in SVN:
http://bugs.php.net/fix.php?id=50261&r=fixed
Fixed in SVN and need be documented:
http://bugs.php.net/fix.php?id=50261&r=needdocs
Fixed in release:
http://bugs.php.net/fix.php?id=50261&r=alreadyfixed
Need backtrace:
http://bugs.php.net/fix.php?id=50261&r=needtrace
Need Reproduce Script:
http://bugs.php.net/fix.php?id=50261&r=needscript
Try newer version:
http://bugs.php.net/fix.php?id=50261&r=oldversion
Not developer issue:
http://bugs.php.net/fix.php?id=50261&r=support
Expected behavior:
http://bugs.php.net/fix.php?id=50261&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=50261&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=50261&r=submittedtwice
register_globals:
http://bugs.php.net/fix.php?id=50261&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=50261&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=50261&r=dst
IIS Stability:
http://bugs.php.net/fix.php?id=50261&r=isapi
Install GNU Sed:
http://bugs.php.net/fix.php?id=50261&r=gnused
Floating point limitations:
http://bugs.php.net/fix.php?id=50261&r=float
No Zend Extensions:
http://bugs.php.net/fix.php?id=50261&r=nozend
MySQL Configuration Error:
http://bugs.php.net/fix.php?id=50261&r=mysqlcfg