3v4l.org

run code in 300+ PHP versions simultaneously
<?php $lol = [ ['for' => '$T4', 'deps' => ['$T3'] ], ['for' => '$T3', 'deps' => ['$T2'] ], ['for' => '$T1', 'deps' => [] ], ['for' => '$T2', 'deps' => ['$T1'] ], ]; uasort($lol, function($a, $b){ if(in_array($a['for'], $b['deps'])) return -1; return 0; }); print_r($lol);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/nQnPQ
function name:  (null)
number of ops:  10
compiled vars:  !0 = $lol
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   10     1        INIT_FCALL                                               'uasort'
          2        SEND_REF                                                 !0
          3        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FnQnPQ%3A10%240'
   14     4        SEND_VAL                                                 ~2
          5        DO_ICALL                                                 
   16     6        INIT_FCALL                                               'print_r'
          7        SEND_VAR                                                 !0
          8        DO_ICALL                                                 
          9      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FnQnPQ%3A10%240:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 10
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/nQnPQ
function name:  {closure}
number of ops:  12
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   11     2        INIT_FCALL                                               'in_array'
          3        FETCH_DIM_R                                      ~2      !0, 'for'
          4        SEND_VAL                                                 ~2
          5        FETCH_DIM_R                                      ~3      !1, 'deps'
          6        SEND_VAL                                                 ~3
          7        DO_ICALL                                         $4      
          8      > JMPZ                                                     $4, ->10
   12     9    > > RETURN                                                   -1
   13    10    > > RETURN                                                   0
   14    11*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FnQnPQ%3A10%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
146.43 ms | 1395 KiB | 19 Q