Bug #70376 [Opn->Asn]: Wrong signature for errors in namespaced anonymous functions

From: Date: Fri, 28 Aug 2015 07:29:12 +0000
Subject: Bug #70376 [Opn->Asn]: Wrong signature for errors in namespaced anonymous functions
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-195583@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=70376&edit=1 ID: 70376 Updated by: bwoebi@php.net Reported by: me at kelunik dot com Summary: Wrong signature for errors in namespaced anonymous functions -Status: Open +Status: Assigned Type: Bug Package: *General Issues PHP Version: 7.0.0RC1 -Assigned To: +Assigned To: jpauli Block user comment: N Private report: N New Comment: This is a regression introduced by the bug fix for #70159 ... https://github.com/php/php-src/commit/a28115ccdb11301a418cc748ef7716a1687cc585#diff-3a8139128d4026ce0cb0c86beba4e6b9 Thus assigning to Julien. Previous Comments: ------------------------------------------------------------------------ [2015-08-28 05:37:06] me at kelunik dot com 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 this bug report at https://bugs.php.net/bug.php?id=70376&edit=1

« previous php.bugs (#195583) next »