Bug #67938 [Ver->Csd]: Segfault when extending interface method with variadic
| From: | nikic@php.net | Date: | Sat, 30 Aug 2014 18:46:58 +0000 |
| Subject: | Bug #67938 [Ver->Csd]: Segfault when extending interface method with variadic | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-187352@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=67938&edit=1
ID: 67938
Updated by: nikic@php.net
Reported by: lisachenko dot it at gmail dot com
Summary: Segfault when extending interface method with
variadic
-Status: Verified
+Status: Closed
Type: Bug
Package: Reproducible crash
Operating System: Windows 7
PHP Version: 5.6.0
Assigned To: nikic
Block user comment: N
Private report: N
New Comment:
Automatic comment on behalf of nikic
Revision: http://git.php.net/?p=php-src.git;a=commit;h=d7368c2531ad1268d43c894b8422a61b70c70e5a
Log: Fix bug #67938: Segfault when extending interface method with variadic
Previous Comments:
------------------------------------------------------------------------
[2014-08-30 17:24:48] lisachenko dot it at gmail dot com
Description:
------------
For traditional OOP code it's possible to add an "extra" optional arguments to the
method defined somewhere in interface without violating it:
interface TestInterface {
public function foo();
}
class Test implements TestInterface {
public function foo($extraArgs=null) {}
}
$obj = new Test;
$obj->foo();
For PHP5.6 variadics can be used nicely for that, but this results in the segfault. See: http://3v4l.org/9bcEJ
Test script:
---------------
interface TestInterface {
public function foo();
}
class Test implements TestInterface {
public function foo(...$extraArgs) {
}
}
$obj = new Test;
$obj->foo();
Expected result:
----------------
Normal termination of script
Actual result:
--------------
Exit code 139, Segmentation fault
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=67938&edit=1