3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = array('a' => 2, 'b' => 1, 'c' => 4); $first = array(key($array) => current($array)); end($array); array_pop($array); array_shift($array); $array = array_merge(array(key($array) => current($array)), $array, $first); print_r($array);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/BkDaB
function name:  (null)
number of ops:  35
compiled vars:  !0 = $array, !1 = $first
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    4     1        INIT_FCALL                                               'key'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $3      
          4        INIT_FCALL                                               'current'
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                         $4      
          7        INIT_ARRAY                                       ~5      $4, $3
          8        ASSIGN                                                   !1, ~5
    5     9        INIT_FCALL                                               'end'
         10        SEND_REF                                                 !0
         11        DO_ICALL                                                 
    6    12        INIT_FCALL                                               'array_pop'
         13        SEND_REF                                                 !0
         14        DO_ICALL                                                 
    7    15        INIT_FCALL                                               'array_shift'
         16        SEND_REF                                                 !0
         17        DO_ICALL                                                 
    8    18        INIT_FCALL                                               'array_merge'
         19        INIT_FCALL                                               'key'
         20        SEND_VAR                                                 !0
         21        DO_ICALL                                         $10     
         22        INIT_FCALL                                               'current'
         23        SEND_VAR                                                 !0
         24        DO_ICALL                                         $11     
         25        INIT_ARRAY                                       ~12     $11, $10
         26        SEND_VAL                                                 ~12
         27        SEND_VAR                                                 !0
         28        SEND_VAR                                                 !1
         29        DO_ICALL                                         $13     
         30        ASSIGN                                                   !0, $13
   10    31        INIT_FCALL                                               'print_r'
         32        SEND_VAR                                                 !0
         33        DO_ICALL                                                 
         34      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
146.2 ms | 1396 KiB | 27 Q