Bug #62084 [Opn->Csd]: Segfault during inheritance check on method
| From: | sebastian@php.net | Date: | Tue, 22 May 2012 05:51:26 +0000 |
| Subject: | Bug #62084 [Opn->Csd]: Segfault during inheritance check on method | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-170658@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=62084&edit=1
ID: 62084
Updated by: sebastian@php.net
Reported by: victor dot kupriyanov at gmail dot com
Summary: Segfault during inheritance check on method
-Status: Open
+Status: Closed
Type: Bug
Package: Scripting Engine problem
Operating System: Any
PHP Version: 5.4.3
-Assigned To:
+Assigned To: sebastian
Block user comment: N
Private report: N
New Comment:
This bug has been fixed in SVN.
Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
For Windows:
http://windows.php.net/snapshots/
Thank you for the report, and for helping us make PHP better.
Previous Comments:
------------------------------------------------------------------------
[2012-05-22 05:51:10] sebastian@php.net
The issue is fixed in the PHP-5.4 branch now:
â ~ php -v
PHP 5.4.5-dev (cli) (built: May 22 2012 07:49:01) (DEBUG)
Copyright (c) 1997-2012 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2012 Zend Technologies
with Xdebug v2.3.0dev, Copyright (c) 2002-2012, by Derick Rethans
â ~ cat /tmp/test.php
<?php
class A {}
class B {
public function b(A $a) {}
}
class C extends B {
public function b($a) {}
}
$a = new C();
â ~ php /tmp/test.php
Strict standards: Declaration of C::b() should be compatible with B::b(A $a) in /tmp/test.php on
line 11
Catchable fatal error: Argument 1 passed to B::b() must be an instance of A, none given, called in
/tmp/test.php on line 13 and defined in /tmp/test.php on line 6
Call Stack:
0.0003 297728 1. {main}() /tmp/test.php:0
0.0004 298672 2. B->b() /tmp/test.php:13
------------------------------------------------------------------------
[2012-05-21 11:10:36] laruence@php.net
The bug seems like #61761 , it has already been fixed in trunk, but seems RM
didn't pick it into 5.4.3 before it was released.
thanks
------------------------------------------------------------------------
[2012-05-21 08:14:36] arjen at react dot com
5.2.0 - 5.2.17, 5.3.0 - 5.3.13 returns correct error.
5.4.0 - 5.4.3 generates segfault.
See http://3v4l.org/fMMr3
------------------------------------------------------------------------
[2012-05-21 03:28:47] victor dot kupriyanov at gmail dot com
I can not reproduce the bug on custom build from the specified snapshot:
$ /tmp/php5.4/bin/php a.php
PHP Strict Standards: Declaration of C::b() should be compatible with B::b(A
$a) in /tmp/a.php on line 13
Strict Standards: Declaration of C::b() should be compatible with B::b(A $a) in
/tmp/a.php on line 13
PHP Catchable fatal error: Argument 1 passed to B::b() must be an instance of
A, none given, called in /tmp/a.php on line 16 and defined in /tmp/a.php on line
8
Catchable fatal error: Argument 1 passed to B::b() must be an instance of A,
none given, called in /tmp/a.php on line 16 and defined in /tmp/a.php on line 8
$ /tmp/php5.4/bin/php -m
[PHP Modules]
apc
Core
ctype
date
dom
ereg
fileinfo
filter
hash
iconv
json
libxml
pcre
PDO
pdo_sqlite
Phar
posix
Reflection
session
SimpleXML
SPL
sqlite3
standard
tokenizer
xml
xmlreader
xmlwriter
[Zend Modules]
So you may assume it is fixed or invalid.
------------------------------------------------------------------------
[2012-05-21 03:07:05] felipe@php.net
Please try using this snapshot:
http://snaps.php.net/php5.4-latest.tar.gz
For Windows:
http://windows.php.net/snapshots/
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
https://bugs.php.net/bug.php?id=62084
--
Edit this bug report at https://bugs.php.net/bug.php?id=62084&edit=1