On Fri, Aug 6, 2010 at 16:33, mathieu.suen <mathieu.s...@easyflirt.com> wrote:
> Hi,
>
> For now you can only index an array using a scalar type or a string.
> Is there some rfc or work going on to enlarge the possibility so that it is
> possible to have some other object like:
>

I don't think it makes sense.

You can however kindof fake it:


$ php -r '$objs = new SplObjectStorage; $std = new stdclass; $std->foo
= 1; $objs->attach($std, array(1,2,3,4)); var_dump($objs[$std]);'
array(4) {
  [0]=>
  int(1)
  [1]=>
  int(2)
  [2]=>
  int(3)
  [3]=>
  int(4)
}


-Hannes

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to