3v4l.org

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
170.14 ms | 1400 KiB | 31 Q