3v4l.org

run code in 300+ PHP versions simultaneously
<?php $sortMe = ['A','B','C','D']; $sortMeToo = ['1','2','3','4']; arsort($sortMe); $sortedKeys = array_keys($sortMe); $newSortMeToo = []; foreach ($sortedKeys as $sortedKey) { $newSortMeToo[] = $sortMeToo[$sortedKey]; } $sortMeToo = $newSortMeToo; var_dump($sortMe); var_dump($sortMeToo);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 11, Position 2 = 16
Branch analysis from position: 11
2 jumps found. (Code = 78) Position 1 = 12, Position 2 = 16
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 11
Branch analysis from position: 11
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 16
filename:       /in/FHLJl
function name:  (null)
number of ops:  25
compiled vars:  !0 = $sortMe, !1 = $sortMeToo, !2 = $sortedKeys, !3 = $newSortMeToo, !4 = $sortedKey
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    4     1        ASSIGN                                                   !1, <array>
    6     2        INIT_FCALL                                               'arsort'
          3        SEND_REF                                                 !0
          4        DO_ICALL                                                 
    7     5        INIT_FCALL                                               'array_keys'
          6        SEND_VAR                                                 !0
          7        DO_ICALL                                         $8      
          8        ASSIGN                                                   !2, $8
    9     9        ASSIGN                                                   !3, <array>
   10    10      > FE_RESET_R                                       $11     !2, ->16
         11    > > FE_FETCH_R                                               $11, !4, ->16
   11    12    >   FETCH_DIM_R                                      ~13     !1, !4
         13        ASSIGN_DIM                                               !3
         14        OP_DATA                                                  ~13
   10    15      > JMP                                                      ->11
         16    >   FE_FREE                                                  $11
   13    17        ASSIGN                                                   !1, !3
   15    18        INIT_FCALL                                               'var_dump'
         19        SEND_VAR                                                 !0
         20        DO_ICALL                                                 
   16    21        INIT_FCALL                                               'var_dump'
         22        SEND_VAR                                                 !1
         23        DO_ICALL                                                 
         24      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
138.44 ms | 1002 KiB | 16 Q