3v4l.org

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.92 ms | 1396 KiB | 27 Q