Bug #61778 [Com]: Crash when overloaded method called from class constructor
Edit report at https://bugs.php.net/bug.php?id=61778&edit=1
ID: 61778
Comment by: nikic@php.net
Reported by: james dot thomsen at gmail dot com
Summary: Crash when overloaded method called from class
constructor
Status: Open
Type: Bug
Package: Reproducible crash
Operating System: Windows 2003
PHP Version: 5.4.0
Block user comment: N
Private report: N
New Comment:
This script runs fine on CLI for me. Could you see whether running on CLI works for you?
Previous Comments:
------------------------------------------------------------------------
[2012-04-19 20:20:31] james dot thomsen at gmail dot com
Description:
------------
If a class overrides a method but with a different signature and that method is called in the
constructor and if error_reporting is set to display strict errors and if the classes are defined in
reverse order, PHP will crash. In my test script, if class one is defined before class two, PHP
won't crash. I realize that overridden methods need to have identical signatures, but I would
expect a warning and not a crash.
Test script:
---------------
error_reporting(-1);
class two extends one{
public function __construct(){
$this->error(7);
}
private function error($n){
echo 'two';
}
}
class one{
private function error(){
echo 'one';
}
}
new two;
Expected result:
----------------
two
Actual result:
--------------
FastCGI Error
The FastCGI Handler was unable to process the request.
Error Details:
The FastCGI process exited unexpectedly
Error Number: -2147467259 (0x80004005).
Error Description: Unspecified error
HTTP Error 500 - Server Error.
Internet Information Services (IIS)
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=61778&edit=1
Thread (5 messages)