3v4l.org

run code in 500+ PHP versions simultaneously
<?php // Sample array $myArray = array( "apple" => 2, "orange" => 5, "banana" => 3, "kiwi" => 1, ); $specialKey = "banana"; $toparray[$specialKey] = $myArray[$specialKey]; unset($myArray[$specialKey]); ksort($myArray); print_r($toparray+$myArray);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/atKpR
function name:  (null)
number of ops:  14
compiled vars:  !0 = $myArray, !1 = $specialKey, !2 = $toparray
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    4     0  E >   ASSIGN                                                       !0, <array>
   11     1        ASSIGN                                                       !1, 'banana'
   12     2        FETCH_DIM_R                                          ~6      !0, !1
          3        ASSIGN_DIM                                                   !2, !1
          4        OP_DATA                                                      ~6
   13     5        UNSET_DIM                                                    !0, !1
   14     6        INIT_FCALL                                                   'ksort'
          7        SEND_REF                                                     !0
          8        DO_ICALL                                                     
   15     9        INIT_FCALL                                                   'print_r'
         10        ADD                                                  ~8      !2, !0
         11        SEND_VAL                                                     ~8
         12        DO_ICALL                                                     
         13      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
157.69 ms | 1724 KiB | 14 Q