3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = array('f' => 0, 'fab' => 1, 'fa' => 2); uksort($a, function($a, $b) { $lenA = strlen($a); $lenB = strlen($b); if ($lenA < $lenB) { return 1; } else if ($lenA === $lenB) { return 0; } else if ($lenA > $lenB) { return -1; } }); var_dump($a);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/k8KHB
function name:  (null)
number of ops:  10
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    5     1        INIT_FCALL                                               'uksort'
          2        SEND_REF                                                 !0
          3        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2Fk8KHB%3A5%240'
   16     4        SEND_VAL                                                 ~2
          5        DO_ICALL                                                 
   18     6        INIT_FCALL                                               'var_dump'
          7        SEND_VAR                                                 !0
          8        DO_ICALL                                                 
          9      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2Fk8KHB%3A5%240:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 10
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
2 jumps found. (Code = 43) Position 1 = 12, Position 2 = 14
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 14
2 jumps found. (Code = 43) Position 1 = 16, Position 2 = 17
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/k8KHB
function name:  {closure}
number of ops:  18
compiled vars:  !0 = $a, !1 = $b, !2 = $lenA, !3 = $lenB
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    6     2        STRLEN                                           ~4      !0
          3        ASSIGN                                                   !2, ~4
    7     4        STRLEN                                           ~6      !1
          5        ASSIGN                                                   !3, ~6
    9     6        IS_SMALLER                                               !2, !3
          7      > JMPZ                                                     ~8, ->10
   10     8    > > RETURN                                                   1
          9*       JMP                                                      ->17
   11    10    >   IS_IDENTICAL                                             !2, !3
         11      > JMPZ                                                     ~9, ->14
   12    12    > > RETURN                                                   0
         13*       JMP                                                      ->17
   13    14    >   IS_SMALLER                                               !3, !2
         15      > JMPZ                                                     ~10, ->17
   14    16    > > RETURN                                                   -1
   16    17    > > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2Fk8KHB%3A5%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
165.76 ms | 1396 KiB | 17 Q