3v4l.org

run code in 500+ PHP versions simultaneously
<?php $array = ["4.0.1", "trunk", "branch", "4.1.0", "4.0.3"]; usort($array, fn($a, $b) => ctype_alpha($a . $b) ? $a <=> $b : version_compare($b, $a)); var_export($array);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Qsksd
function name:  (null)
number of ops:  10
compiled vars:  !0 = $array
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, <array>
    5     1        INIT_FCALL                                                   'usort'
          2        SEND_REF                                                     !0
          3        DECLARE_LAMBDA_FUNCTION                              ~2      [0]
          4        SEND_VAL                                                     ~2
          5        DO_ICALL                                                     
    7     6        INIT_FCALL                                                   'var_export'
          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 = 43) Position 1 = 7, Position 2 = 10
Branch analysis from position: 7
1 jumps found. (Code = 42) Position 1 = 15
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Qsksd
function name:  {closure:/in/Qsksd:5}
number of ops:  17
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    5     0  E >   RECV                                                 !0      
          1        RECV                                                 !1      
          2        INIT_FCALL                                                   'ctype_alpha'
          3        CONCAT                                               ~2      !0, !1
          4        SEND_VAL                                                     ~2
          5        DO_ICALL                                             $3      
          6      > JMPZ                                                         $3, ->10
          7    >   SPACESHIP                                            ~4      !0, !1
          8        QM_ASSIGN                                            ~5      ~4
          9      > JMP                                                          ->15
         10    >   INIT_FCALL                                                   'version_compare'
         11        SEND_VAR                                                     !1
         12        SEND_VAR                                                     !0
         13        DO_ICALL                                             $6      
         14        QM_ASSIGN                                            ~5      $6
         15    > > RETURN                                                       ~5
         16*     > RETURN                                                       null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
171.83 ms | 2093 KiB | 17 Q