Bug #70376 [NEW]: Wrong signature for errors in namespaced anonymous functions

From: Date: Fri, 28 Aug 2015 05:37:10 +0000
Subject: Bug #70376 [NEW]: Wrong signature for errors in namespaced anonymous functions
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-195581@lists.php.net to get a copy of this message
From: me at kelunik dot com Operating system: PHP version: 7.0.0RC1 Package: *General Issues Bug Type: Bug Bug description:Wrong signature for errors in namespaced anonymous functions Description: ------------ The namespace shouldn't be repeated after :: and -> for anonymous functions. https://3v4l.org/F7R3l#v700alpha2 Test script: --------------- <?php namespace A { class Foo { public $foo; public function __construct() { $this->foo = function (int $a) { var_dump("foo"); }; } } } namespace { ((new A\Foo)->foo)(null); } Expected result: ---------------- Fatal error: Uncaught TypeError: Argument 1 passed to A\Foo::{closure}() must be of the type integer, null given, called in /in/F7R3l on line 16 and defined in /in/F7R3l:8 Stack trace: #0 /in/F7R3l(16): A\Foo->{closure}(NULL) #1 {main} thrown in /in/F7R3l on line 8 Actual result: -------------- Fatal error: Uncaught TypeError: Argument 1 passed to A\Foo::A\{closure}() must be of the type integer, null given, called in /in/F7R3l on line 16 and defined in /in/F7R3l:8 Stack trace: #0 /in/F7R3l(16): A\Foo->A\{closure}(NULL) #1 {main} thrown in /in/F7R3l on line 8 -- Edit bug report at https://bugs.php.net/bug.php?id=70376&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=70376&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=70376&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=70376&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=70376&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=70376&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=70376&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=70376&r=needscript Try newer version: https://bugs.php.net/fix.php?id=70376&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=70376&r=support Expected behavior: https://bugs.php.net/fix.php?id=70376&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=70376&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=70376&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=70376&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=70376&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=70376&r=dst IIS Stability: https://bugs.php.net/fix.php?id=70376&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=70376&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=70376&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=70376&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=70376&r=mysqlcfg

« previous php.bugs (#195581) next »