Re: [RFC]

From: Date: Tue, 11 Feb 2020 15:27:47 +0000
Subject: Re: [RFC]
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-108486@lists.php.net to get a copy of this message
I have three immediate thoughts: 1. It should be fn or function; reserving a new word even if it's contextual is pointless here. 2. It should support methods. 3. It should return a closure, not a string. The reason is for consistency with methods, where we want to capture the scope at the time the closure is created, not ran. Imagine passing a private method as a callback; if it was done via [$obj, 'privatemethod'] then it will fail at runtime, because the scope it's called in doesn't have access.

« previous php.internals (#108486) next »