Re: [PHP-DEV] Re: $arr = array('Hello', 'world'); $arr();

2011-07-14 Thread Felipe Pena
2011/7/14 Rune Kaagaard : > Will this work: > >    array('foo', 'bar')('arg1', 'arg2') > > ? > No, and it isn't supposed to either. -- Regards, Felipe Pena -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] Re: $arr = array('Hello', 'world'); $arr();

2011-07-14 Thread Rune Kaagaard
Will this work: array('foo', 'bar')('arg1', 'arg2') ? On Wed, Jun 8, 2011 at 3:48 PM, Christian Kaps wrote: > On Wed, 8 Jun 2011 15:39:59 +0200, Jordi Boggiano wrote: >> >> On Wed, Jun 8, 2011 at 2:46 PM, Felipe Pena wrote: >>> >>> class foo { >>>   public function __construct() { >>>    

Re: [PHP-DEV] Re: $arr = array('Hello', 'world'); $arr();

2011-06-08 Thread Christian Kaps
On Wed, 8 Jun 2011 15:39:59 +0200, Jordi Boggiano wrote: On Wed, Jun 8, 2011 at 2:46 PM, Felipe Pena wrote: class foo {   public function __construct() {      $this->bar = function () { return 1; };      // $this->bar(); // error      $x = $this->bar;      $x(); // ok      $this->bar = array($

Re: [PHP-DEV] Re: $arr = array('Hello', 'world'); $arr();

2011-06-08 Thread Christian Kaps
On Wed, 8 Jun 2011 09:46:26 -0300, Felipe Pena wrote: It works in the same way: class foo { public function __construct() { $this->bar = function () { return 1; }; // $this->bar(); // error $x = $this->bar; $x(); // ok $this->bar = array($this, 'baz'); //

Re: [PHP-DEV] Re: $arr = array('Hello', 'world'); $arr();

2011-06-08 Thread Jordi Boggiano
On Wed, Jun 8, 2011 at 2:46 PM, Felipe Pena wrote: > class foo { >   public function __construct() { >      $this->bar = function () { return 1; }; >      // $this->bar(); // error >      $x = $this->bar; >      $x(); // ok > >      $this->bar = array($this, 'baz'); >      // $this->bar(); // erro

Re: [PHP-DEV] Re: $arr = array('Hello', 'world'); $arr();

2011-06-08 Thread Felipe Pena
2011/6/8 Christian Kaps > On Wed, 8 Jun 2011 08:57:48 -0300, Felipe Pena wrote: > >> Hi, >> >> 2011/6/8 Christian Kaps >> >> Hi, >>> >>> >>> what happens if I use this code. >>> >>> class Foo { >>> >>> public $bar; >>> >>> public function __construct() { >>> >>> $this->bar = array($this,

Re: [PHP-DEV] Re: $arr = array('Hello', 'world'); $arr();

2011-06-08 Thread Christian Kaps
On Wed, 8 Jun 2011 08:57:48 -0300, Felipe Pena wrote: Hi, 2011/6/8 Christian Kaps Hi, what happens if I use this code. class Foo { public $bar; public function __construct() { $this->bar = array($this, 'baz'); $this->bar(); } public function bar() { echo 'bar';

Re: [PHP-DEV] Re: $arr = array('Hello', 'world'); $arr();

2011-06-08 Thread Felipe Pena
Hi, 2011/6/8 Christian Kaps > Hi, > > > Hi all, >> Reading our bug tracker I noticed a good feature request [1] from 2009 >> which >> points to an interesting feature that I think makes sense for us, since we >> are now working with $f() using objects and strings, and the >> array('class', >> '

[PHP-DEV] Re: $arr = array('Hello', 'world'); $arr();

2011-06-08 Thread Christian Kaps
Hi, Hi all, Reading our bug tracker I noticed a good feature request [1] from 2009 which points to an interesting feature that I think makes sense for us, since we are now working with $f() using objects and strings, and the array('class', 'method') is an old known for call_user_func()-like

[PHP-DEV] Re: $arr = array('Hello', 'world'); $arr();

2011-06-06 Thread Matthew Weier O'Phinney
On 2011-06-05, Felipe Pena wrote: > Reading our bug tracker I noticed a good feature request [1] from 2009 > which points to an interesting feature that I think makes sense for > us, since we are now working with $f() using objects and strings, and > the array('class', 'method') is an old known fo