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 = array_merge(array(key($array) => current($array)), array_pop(array_shift($array)), $first); print_r($array);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/TpFIo
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_merge'
         13        INIT_FCALL                                               'key'
         14        SEND_VAR                                                 !0
         15        DO_ICALL                                         $8      
         16        INIT_FCALL                                               'current'
         17        SEND_VAR                                                 !0
         18        DO_ICALL                                         $9      
         19        INIT_ARRAY                                       ~10     $9, $8
         20        SEND_VAL                                                 ~10
         21        INIT_FCALL                                               'array_pop'
         22        INIT_FCALL                                               'array_shift'
         23        SEND_REF                                                 !0
         24        DO_ICALL                                         $11     
         25        SEND_VAR_NO_REF                               0          $11
         26        DO_ICALL                                         $12     
         27        SEND_VAR                                                 $12
         28        SEND_VAR                                                 !1
         29        DO_ICALL                                         $13     
         30        ASSIGN                                                   !0, $13
    8    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:
164.12 ms | 1396 KiB | 27 Q