3v4l.org

run code in 300+ PHP versions simultaneously
$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));<?php
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/AohP9
function name:  (null)
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    1     0  E >   ECHO                                                     '%24array+%3D+array%28%27first%27%3D%3E%27111%27%2C+%27second%27%3D%3E%27222%27%2C+%27third%27%3D%3E%27333%27%29%3B%0A%0A++%2F%2F+get+the+first+key%3A+returns+%27first%27%0A++print+array_shift%28array_keys%28%24array%29%29%3B%0A%0A++%2F%2F+get+the+last+key%3A+returns+%27third%27%0A++print+array_pop%28array_keys%28%24array%29%29%3B%0A%0A++%2F%2F+get+the+first+value%3A+returns+%27111%27%0A++print+array_shift%28array_values%28%24array%29%29%3B%0A%0A++%2F%2F+get+the+last+value%3A+returns+%27333%27%0A++print+array_pop%28array_values%28%24array%29%29%3B'
   13     1      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
142.93 ms | 1392 KiB | 13 Q