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));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/PZDq1
function name:  (null)
number of ops:  30
compiled vars:  !0 = $array
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    6     1        INIT_FCALL                                               'array_shift'
          2        INIT_FCALL                                               'array_keys'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $2      
          5        SEND_VAR_NO_REF                               0          $2
          6        DO_ICALL                                         $3      
          7        ECHO                                                     $3
    9     8        INIT_FCALL                                               'array_pop'
          9        INIT_FCALL                                               'array_keys'
         10        SEND_VAR                                                 !0
         11        DO_ICALL                                         $4      
         12        SEND_VAR_NO_REF                               0          $4
         13        DO_ICALL                                         $5      
         14        ECHO                                                     $5
   12    15        INIT_FCALL                                               'array_shift'
         16        INIT_FCALL                                               'array_values'
         17        SEND_VAR                                                 !0
         18        DO_ICALL                                         $6      
         19        SEND_VAR_NO_REF                               0          $6
         20        DO_ICALL                                         $7      
         21        ECHO                                                     $7
   15    22        INIT_FCALL                                               'array_pop'
         23        INIT_FCALL                                               'array_values'
         24        SEND_VAR                                                 !0
         25        DO_ICALL                                         $8      
         26        SEND_VAR_NO_REF                               0          $8
         27        DO_ICALL                                         $9      
         28        ECHO                                                     $9
         29      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
173.16 ms | 1395 KiB | 21 Q