Hi Rowan,
On Fri, Mar 20, 2015 at 7:12 AM, Rowan Collins rowan.coll...@gmail.com
wrote:
On 19/03/2015 20:50, Yasuo Ohgaki wrote:
Hi Sebastian,
On Thu, Mar 19, 2015 at 9:48 PM, Sebastian B.-Hagensen
sbj.ml.r...@gmail.com mailto:sbj.ml.r...@gmail.com wrote:
2015-03-19 12:51 GMT+01:00
On 19/03/2015 22:43, Yasuo Ohgaki wrote:
Hi Rowan,
On Fri, Mar 20, 2015 at 7:12 AM, Rowan Collins
rowan.coll...@gmail.com mailto:rowan.coll...@gmail.com wrote:
On 19/03/2015 20:50, Yasuo Ohgaki wrote:
Hi Sebastian,
On Thu, Mar 19, 2015 at 9:48 PM, Sebastian B.-Hagensen
On 19/03/2015 20:50, Yasuo Ohgaki wrote:
Hi Sebastian,
On Thu, Mar 19, 2015 at 9:48 PM, Sebastian B.-Hagensen
sbj.ml.r...@gmail.com mailto:sbj.ml.r...@gmail.com wrote:
2015-03-19 12:51 GMT+01:00 Yasuo Ohgaki yohg...@ohgaki.net
mailto:yohg...@ohgaki.net:
Distinguishing array and
Hi Rowan,
On Fri, Mar 20, 2015 at 8:00 AM, Rowan Collins rowan.coll...@gmail.com
wrote:
I had no intention of restricting the discussion in any way, apologies if
it came across that way.
Perhaps what I should have said is it is not *only* time that is needed -
we need to design the
Hi all,
On Sun, Mar 15, 2015 at 7:15 PM, Nicolas Grekas
nicolas.grekas+...@gmail.com wrote:
Foo::bar(); // OK
['Foo', 'bar'](); // OK
'Foo::bar'(); // FATAL ERROR
Hi,
does this topic need to be addressed before PHP7 goes feature freeze? Or is
it a bugfix? (Julien already
Hi,
2015-03-19 12:51 GMT+01:00 Yasuo Ohgaki yohg...@ohgaki.net:
Distinguishing array and callable is problematic.
Array callable is better to be deprecated in the long run. IMHO.
Then how would you write an callback containing an already constructed object?
$a = [$object, 'method'];
The
There's then the question of what kind of object it would return - a
Closure? Some child or sibling of Closure? What methods could be usefully
provided?
Yes, it's a closure. I've actually fleshed this out quite a bit, and
there are a few important questions:
- With methods do you allow
Hi,
Am 19.03.2015 um 20:26 schrieb Levi Morrison:
On Thu, Mar 19, 2015 at 1:05 PM, Dennis Birkholz den...@birkholz.biz wrote:
Hi,
Am 19.03.2015 um 17:27 schrieb Sebastian B.-Hagensen:
Another way to unify array and string callback may be to use the
callable syntax and have it return a
Sebastian B.-Hagensen wrote on 19/03/2015 16:27:
Another way to unify array and string callback may be to use the
callable syntax and have it return a closure:
callable('strlen');
callable($object, $methodName);
callable('class', 'staticMethod')
Andrea proposed a slightly different syntax for
Hi,
Am 19.03.2015 um 17:27 schrieb Sebastian B.-Hagensen:
Another way to unify array and string callback may be to use the
callable syntax and have it return a closure:
callable('strlen');
callable($object, $methodName);
callable('class', 'staticMethod')
but before that happens, we should
On Thu, Mar 19, 2015 at 1:05 PM, Dennis Birkholz den...@birkholz.biz wrote:
Hi,
Am 19.03.2015 um 17:27 schrieb Sebastian B.-Hagensen:
Another way to unify array and string callback may be to use the
callable syntax and have it return a closure:
callable('strlen');
callable($object,
On Thu, Mar 19, 2015 at 1:44 PM, Dennis Birkholz den...@birkholz.biz wrote:
Hi,
Am 19.03.2015 um 20:26 schrieb Levi Morrison:
On Thu, Mar 19, 2015 at 1:05 PM, Dennis Birkholz den...@birkholz.biz wrote:
Hi,
Am 19.03.2015 um 17:27 schrieb Sebastian B.-Hagensen:
Another way to unify array and
Hi Sebastian,
On Thu, Mar 19, 2015 at 9:48 PM, Sebastian B.-Hagensen
sbj.ml.r...@gmail.com wrote:
2015-03-19 12:51 GMT+01:00 Yasuo Ohgaki yohg...@ohgaki.net:
Distinguishing array and callable is problematic.
Array callable is better to be deprecated in the long run. IMHO.
Then how would
Then how would you write an callback containing an already constructed object?
$a = [$object, 'method'];
The alternative is unnecessarily cumbersome:
$a = function($methodArg1, $methodArg2) use($object) { return
$object-method($methodArg1, $methodArg2); };
$object-$methodName(...$args);
--
On Thursday 19 March 2015 18:17:50 S.A.N wrote:
Then how would you write an callback containing an already constructed
object? $a = [$object, 'method'];
The alternative is unnecessarily cumbersome:
$a = function($methodArg1, $methodArg2) use($object) { return
Hi,
2015-03-19 17:17 GMT+01:00 S.A.N ua.san.a...@gmail.com:
Then how would you write an callback containing an already constructed
object?
$a = [$object, 'method'];
The alternative is unnecessarily cumbersome:
$a = function($methodArg1, $methodArg2) use($object) { return
I've always liked how callbacks (well, function pointers) are handled in C -
using the function name without parentheses. eg.
$a = $object-method;
But this wouldn't work in PHP as is, since property and method names would
collide. How do people feel about the fact that we have separate
Foo::bar(); // OK
['Foo', 'bar'](); // OK
'Foo::bar'(); // FATAL ERROR
Hi,
does this topic need to be addressed before PHP7 goes feature freeze? Or is
it a bugfix? (Julien already provided a patch)
I'm not familiar with writing RFCs. I fear I won't be able to handle it on
schedule if one
On 24 January 2015 00:15:01 GMT, Stanislav Malyshev smalys...@gmail.com wrote:
Hi!
Foo::bar(); // OK
['Foo', 'bar'](); // OK
'Foo::bar'(); // FATAL ERROR
I'm not sure why one would ever need/want the latter. IMO, it just
looks
weird.
Well, they both look weird as literals like that, but the
Andrea Faulds wrote on 23/01/2015 14:37:
Hey Nikita,
On 20 Jan 2015, at 21:46, Nikita Popov nikita@gmail.com wrote:
On Tue, Jan 20, 2015 at 9:54 PM, Marc Bennewitz dev@mabe.berlin wrote:
valid for call_user_func[_array] and callable type-hint but invalid for
for direct variable calls:
-
Hi!
Foo::bar(); // OK
['Foo', 'bar'](); // OK
'Foo::bar'(); // FATAL ERROR
I'm not sure why one would ever need/want the latter. IMO, it just looks
weird.
--
Stas Malyshev
smalys...@gmail.com
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit:
I'm not sure though if it should be done by adding
'foo::bar' to $a() or removing it from call_user_func().
call_user_func('foo::bar') work since 5.2.2 (see http://3v4l.org/k2SOU).
Is there a serious reason to break code that is perfectly fine since 2007.
Breaking BC needs a serious reason
Hey Nikita,
On 20 Jan 2015, at 21:46, Nikita Popov nikita@gmail.com wrote:
On Tue, Jan 20, 2015 at 9:54 PM, Marc Bennewitz dev@mabe.berlin wrote:
valid for call_user_func[_array] and callable type-hint but invalid for
for direct variable calls:
- string MyClass::staticFunc
- string
Hi!
It’s technically a 'language change’ and would affect the language
specification. That said, it seems rather “no-brainer”.
I think it makes a lot of sense to have call_user_func() and $a() work
identically. I'm not sure though if it should be done by adding
'foo::bar' to $a() or removing
On Tue, Jan 20, 2015 at 1:59 PM, Adam Harvey ahar...@php.net wrote:
On 20 January 2015 at 12:54, Marc Bennewitz dev@mabe.berlin wrote:
valid for call_user_func[_array] and callable type-hint but invalid for for
direct variable calls:
- string MyClass::staticFunc
- string self::staticFunc
-
Hey Marc,
On 20 Jan 2015, at 20:54, Marc Bennewitz dev@mabe.berlin wrote:
valid for call_user_func[_array] and callable type-hint but invalid for for
direct variable calls:
- string MyClass::staticFunc
- string self::staticFunc
- string static::staticFunc
- string parent::func
- string
On Tue, Jan 20, 2015 at 9:54 PM, Marc Bennewitz dev@mabe.berlin wrote:
valid for call_user_func[_array] and callable type-hint but invalid for
for direct variable calls:
- string MyClass::staticFunc
- string self::staticFunc
- string static::staticFunc
- string parent::func
- string
Hey Adam,
On 20 Jan 2015, at 20:59, Adam Harvey ahar...@php.net wrote:
On 20 January 2015 at 12:54, Marc Bennewitz dev@mabe.berlin wrote:
valid for call_user_func[_array] and callable type-hint but invalid for for
direct variable calls:
- string MyClass::staticFunc
- string
On 20 January 2015 at 12:54, Marc Bennewitz dev@mabe.berlin wrote:
valid for call_user_func[_array] and callable type-hint but invalid for for
direct variable calls:
- string MyClass::staticFunc
- string self::staticFunc
- string static::staticFunc
- string parent::func
- string
On 20.01.2015 22:46, Nikita Popov wrote:
On Tue, Jan 20, 2015 at 9:54 PM, Marc Bennewitz dev@mabe.berlin
mailto:dev@mabe.berlin wrote:
valid for call_user_func[_array] and callable type-hint but invalid
for for direct variable calls:
- string MyClass::staticFunc
- string
valid for call_user_func[_array] and callable type-hint but invalid for
for direct variable calls:
- string MyClass::staticFunc
- string self::staticFunc
- string static::staticFunc
- string parent::func
- string parent::staticFunc
see http://3v4l.org/1oSO3
Thoughts ?
--
PHP Internals - PHP
31 matches
Mail list logo