2010/11/29 Felipe Pena <felipe...@gmail.com> > It also probably makes sense to add array deference chaining e.g. new >> Foo()[] (just for language consistency). >> >> > Hmm, looks good to me. :) > > I've updated the patch with the bracketed version to include the array dereferecing support: http://felipe.ath.cx/diff/instance-method-call-3.patch
<?php class foo extends ArrayObject { public function __construct($arr) { parent::__construct($arr); } } $arr = array(1, 2, 3); $value = (new foo($arr))[1]; // int(2) ?> Some tests: http://felipe.ath.cx/diff/instance_direct_access_001.phpt -- Regards, Felipe Pena