3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = ['bananna', 'cranberry', 'apple']; $fn = function ($a, $b) { if(strlen($a) > strlen($b)) { return 1; } return 0; }; usort($array, $fn); var_dump( $array);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/qZr7g
function name:  (null)
number of ops:  11
compiled vars:  !0 = $array, !1 = $fn
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    4     1        DECLARE_LAMBDA_FUNCTION                          ~3      [0]
          2        ASSIGN                                                   !1, ~3
   10     3        INIT_FCALL                                               'usort'
          4        SEND_REF                                                 !0
          5        SEND_VAR                                                 !1
          6        DO_ICALL                                                 
   11     7        INIT_FCALL                                               'var_dump'
          8        SEND_VAR                                                 !0
          9        DO_ICALL                                                 
         10      > RETURN                                                   1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 7
Branch analysis from position: 6
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/qZr7g
function name:  {closure}
number of ops:  9
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    5     2        STRLEN                                           ~2      !0
          3        STRLEN                                           ~3      !1
          4        IS_SMALLER                                               ~3, ~2
          5      > JMPZ                                                     ~4, ->7
    6     6    > > RETURN                                                   1
    8     7    > > RETURN                                                   0
    9     8*     > RETURN                                                   null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
145.87 ms | 1460 KiB | 15 Q