3v4l.org

run code in 300+ PHP versions simultaneously
<?php function MyArray() { return array('de'=>array('eins','zwei','drei')); } // based on feature request for PHP3, nine years ago, per https://bugs.php.net/bug.php?id=2341 // bug refiled from version 3 to version 4 // but Sterling Hughes felt the 'WTF' factor was too high to have it fixed // now should work in PHP5.5 $arr1DE=myArray()['de']; $arr2DE=array('de'=>array('eins','zwei','drei'))['de']; var_dump($arr1DE, $arr2DE);
Output for git.master, git.master_jit, rfc.property-hooks
array(3) { [0]=> string(4) "eins" [1]=> string(4) "zwei" [2]=> string(4) "drei" } array(3) { [0]=> string(4) "eins" [1]=> string(4) "zwei" [2]=> string(4) "drei" }

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:
57.76 ms | 401 KiB | 8 Q