3v4l.org

run code in 300+ PHP versions simultaneously
<?php $storage = new SplObjectStorage; $foo = (object)['foo' => 'bar']; $storage->attach($foo, ['room' => 'bar']); foreach ($storage as $value) { $obj = $storage->current(); // current object $assoc_key = $storage->getInfo(); // return, if exists, associated with cur. obj. data; else NULL var_dump($obj); var_dump($assoc_dump); }
Output for git.master, git.master_jit, rfc.property-hooks
object(stdClass)#2 (1) { ["foo"]=> string(3) "bar" } Warning: Undefined variable $assoc_dump in /in/2Dqe7 on line 12 NULL

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
41.44 ms | 401 KiB | 8 Q