3v4l.org

run code in 300+ PHP versions simultaneously
<?php $data = [ 'c' => [ 'confidence' => 0.999, 'name' => 'not_valid.png', ], 'a' => [ 'confidence' => 0.999, 'name' => 'valid.png', ], 'b' => [ 'confidence' => 0.98, 'name' => 'valid.png', ], 'd' => [ 'confidence' => 0.98, 'name' => 'not_valid.png', ], ]; uasort($data, function (array $a, array $b) { if (array_key_exists('name', $a) && $a['name'] != 'not_valid.png') { if (array_key_exists('name', $b) && $b['name'] != 'not_valid.png') { if ($a['confidence'] == $b['confidence']) { return 0; } return $a['confidence'] > $b['confidence'] ? -1 : 1; } return -1; } else if (array_key_exists('name', $b) && $b['name'] != 'not_valid.png') { return 1; } if ($a['confidence'] == $b['confidence']) { return 0; } return $a['confidence'] > $b['confidence'] ? -1 : 1; }); var_dump($data);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/3Hnbb
function name:  (null)
number of ops:  10
compiled vars:  !0 = $data
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   22     1        INIT_FCALL                                               'uasort'
          2        SEND_REF                                                 !0
          3        DECLARE_LAMBDA_FUNCTION                          ~2      [0]
   41     4        SEND_VAL                                                 ~2
   22     5        DO_ICALL                                                 
   43     6        INIT_FCALL                                               'var_dump'
          7        SEND_VAR                                                 !0
          8        DO_ICALL                                                 
          9      > RETURN                                                   1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 46) Position 1 = 4, Position 2 = 7
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 29
Branch analysis from position: 8
2 jumps found. (Code = 46) Position 1 = 10, Position 2 = 13
Branch analysis from position: 10
2 jumps found. (Code = 43) Position 1 = 14, Position 2 = 27
Branch analysis from position: 14
2 jumps found. (Code = 43) Position 1 = 18, Position 2 = 19
Branch analysis from position: 18
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 19
2 jumps found. (Code = 43) Position 1 = 23, Position 2 = 25
Branch analysis from position: 23
1 jumps found. (Code = 42) Position 1 = 26
Branch analysis from position: 26
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 25
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 27
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
Branch analysis from position: 29
2 jumps found. (Code = 46) Position 1 = 31, Position 2 = 34
Branch analysis from position: 31
2 jumps found. (Code = 43) Position 1 = 35, Position 2 = 36
Branch analysis from position: 35
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 36
2 jumps found. (Code = 43) Position 1 = 40, Position 2 = 41
Branch analysis from position: 40
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 41
2 jumps found. (Code = 43) Position 1 = 45, Position 2 = 47
Branch analysis from position: 45
1 jumps found. (Code = 42) Position 1 = 48
Branch analysis from position: 48
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 47
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 34
Branch analysis from position: 7
filename:       /in/3Hnbb
function name:  {closure}
number of ops:  50
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   22     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   23     2        ARRAY_KEY_EXISTS                                 ~2      'name', !0
          3      > JMPZ_EX                                          ~2      ~2, ->7
          4    >   FETCH_DIM_R                                      ~3      !0, 'name'
          5        IS_NOT_EQUAL                                     ~4      ~3, 'not_valid.png'
          6        BOOL                                             ~2      ~4
          7    > > JMPZ                                                     ~2, ->29
   24     8    >   ARRAY_KEY_EXISTS                                 ~5      'name', !1
          9      > JMPZ_EX                                          ~5      ~5, ->13
         10    >   FETCH_DIM_R                                      ~6      !1, 'name'
         11        IS_NOT_EQUAL                                     ~7      ~6, 'not_valid.png'
         12        BOOL                                             ~5      ~7
         13    > > JMPZ                                                     ~5, ->27
   25    14    >   FETCH_DIM_R                                      ~8      !0, 'confidence'
         15        FETCH_DIM_R                                      ~9      !1, 'confidence'
         16        IS_EQUAL                                                 ~8, ~9
         17      > JMPZ                                                     ~10, ->19
   26    18    > > RETURN                                                   0
   29    19    >   FETCH_DIM_R                                      ~11     !0, 'confidence'
         20        FETCH_DIM_R                                      ~12     !1, 'confidence'
         21        IS_SMALLER                                               ~12, ~11
         22      > JMPZ                                                     ~13, ->25
         23    >   QM_ASSIGN                                        ~14     -1
         24      > JMP                                                      ->26
         25    >   QM_ASSIGN                                        ~14     1
         26    > > RETURN                                                   ~14
   31    27    > > RETURN                                                   -1
   23    28*       JMP                                                      ->36
   32    29    >   ARRAY_KEY_EXISTS                                 ~15     'name', !1
         30      > JMPZ_EX                                          ~15     ~15, ->34
         31    >   FETCH_DIM_R                                      ~16     !1, 'name'
         32        IS_NOT_EQUAL                                     ~17     ~16, 'not_valid.png'
         33        BOOL                                             ~15     ~17
         34    > > JMPZ                                                     ~15, ->36
   33    35    > > RETURN                                                   1
   36    36    >   FETCH_DIM_R                                      ~18     !0, 'confidence'
         37        FETCH_DIM_R                                      ~19     !1, 'confidence'
         38        IS_EQUAL                                                 ~18, ~19
         39      > JMPZ                                                     ~20, ->41
   37    40    > > RETURN                                                   0
   40    41    >   FETCH_DIM_R                                      ~21     !0, 'confidence'
         42        FETCH_DIM_R                                      ~22     !1, 'confidence'
         43        IS_SMALLER                                               ~22, ~21
         44      > JMPZ                                                     ~23, ->47
         45    >   QM_ASSIGN                                        ~24     -1
         46      > JMP                                                      ->48
         47    >   QM_ASSIGN                                        ~24     1
         48    > > RETURN                                                   ~24
   41    49*     > RETURN                                                   null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
140.35 ms | 1011 KiB | 15 Q