3v4l.org

run code in 300+ PHP versions simultaneously
<?php $value = 2; $array = [1, 2, 3]; array_unshift($array,$value); // prepend a duplicate var_export(array_unique($array)); // kill the original echo "\n---\n"; $value = 2; $array = [1, 2, 3]; var_export(array_unique(array_merge([$value],$array))); // prepend a duplicate, kill the original echo "\n---\n"; $value = 2; $array = [1, 2, 3]; array_unshift($array,$value); // prepend a duplicate var_export(array_keys(array_keys($array))); // kill the original echo "\n---\n"; $value = 2; $array = [1, 2, 3]; var_export(array_keys(array_keys(array_merge([$value],$array)))); // prepend a duplicate, kill the original
Output for git.master_jit, git.master, rfc.property-hooks
array ( 0 => 2, 1 => 1, 3 => 3, ) --- array ( 0 => 2, 1 => 1, 3 => 3, ) --- array ( 0 => 0, 1 => 1, 2 => 2, 3 => 3, ) --- array ( 0 => 0, 1 => 1, 2 => 2, 3 => 3, )

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