3v4l.org

run code in 200+ php & hhvm versions
<?php $array = array( 0 => 'val1', 2 => 'val2', 'A' => 'val3', 5 => 'val4', 7 => 'val5' ); $array = [...$array]; var_export($array);
based on KWPRH

Shows result from various feature-branches currently under review from the php developers. Contact me to have additional branches featured.

Output for branch php-master
Fatal error: Uncaught Error: Cannot unpack array with string keys in /in/2IgGh:10 Stack trace: #0 {main} thrown in /in/2IgGh on line 10
Process exited with code 255.
Output for branch php-master+opcache
Fatal error: Uncaught Error: Cannot unpack array with string keys in /in/2IgGh:10 Stack trace: #0 {main} thrown in /in/2IgGh on line 10
Process exited with code 255.
Output for branch php-master+jit
Fatal error: Uncaught Error: Cannot unpack array with string keys in /in/2IgGh:10 Stack trace: #0 {main} thrown in /in/2IgGh on line 10
Process exited with code 255.

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