3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = array('first'=>'111', 'second'=>'222', 'third'=>'333'); // get the first key: returns 'first' print array_shift(array_keys($array)); // get the last key: returns 'third' print array_pop(array_keys($array)); // get the first value: returns '111' print array_shift(array_values($array)); // get the last value: returns '333' print array_pop(array_values($array));
Output for git.master, git.master_jit, rfc.property-hooks
Notice: Only variables should be passed by reference in /in/PZDq1 on line 6 first Notice: Only variables should be passed by reference in /in/PZDq1 on line 9 third Notice: Only variables should be passed by reference in /in/PZDq1 on line 12 111 Notice: Only variables should be passed by reference in /in/PZDq1 on line 15 333

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:
34.18 ms | 402 KiB | 8 Q