Bug #67938 [NEW]: Segfault when extending interface method with variadic
| From: | lisachenko dot it at gmail dot com | Date: | Sat, 30 Aug 2014 17:24:49 +0000 |
| Subject: | Bug #67938 [NEW]: Segfault when extending interface method with variadic | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-187350@lists.php.net to get a copy of this message | ||
From: lisachenko dot it at gmail dot com
Operating system: Windows 7
PHP version: 5.6.0
Package: Reproducible crash
Bug Type: Bug
Bug description:Segfault when extending interface method with variadic
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 bug report at https://bugs.php.net/bug.php?id=67938&edit=1
--