3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ ['array-5', 0], ['array-7', -.5], ['array-4', 0], ['array-1',-1], ['array-3', 2], ['array-6', .5], ['array-2', 3], ['array-8', -2] ]; $notNegs = []; $absVals = []; foreach ($array as [1 => $v]) { $abs = abs($v); $absVals[] = $abs; $notNegs[] = $v === $abs; } array_multisort($notNegs, $absVals, SORT_DESC, $array); var_export($array);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 4, Position 2 = 18
Branch analysis from position: 4
2 jumps found. (Code = 78) Position 1 = 5, Position 2 = 18
Branch analysis from position: 5
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 18
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 18
filename:       /in/GXbZ3
function name:  (null)
number of ops:  29
compiled vars:  !0 = $array, !1 = $notNegs, !2 = $absVals, !3 = $v, !4 = $abs
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   14     1        ASSIGN                                                   !1, <array>
   15     2        ASSIGN                                                   !2, <array>
   16     3      > FE_RESET_R                                       $8      !0, ->18
          4    > > FE_FETCH_R                                               $8, $9, ->18
          5    >   FETCH_LIST_R                                     $10     $9, 1
          6        ASSIGN                                                   !3, $10
          7        FREE                                                     $9
   17     8        INIT_FCALL                                               'abs'
          9        SEND_VAR                                                 !3
         10        DO_ICALL                                         $12     
         11        ASSIGN                                                   !4, $12
   18    12        ASSIGN_DIM                                               !2
         13        OP_DATA                                                  !4
   19    14        IS_IDENTICAL                                     ~16     !3, !4
         15        ASSIGN_DIM                                               !1
         16        OP_DATA                                                  ~16
   16    17      > JMP                                                      ->4
         18    >   FE_FREE                                                  $8
   21    19        INIT_FCALL                                               'array_multisort'
         20        SEND_REF                                                 !1
         21        SEND_REF                                                 !2
         22        SEND_VAL                                                 3
         23        SEND_REF                                                 !0
         24        DO_ICALL                                                 
   22    25        INIT_FCALL                                               'var_export'
         26        SEND_VAR                                                 !0
         27        DO_ICALL                                                 
         28      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
138.62 ms | 1072 KiB | 16 Q