3v4l.org

run code in 300+ PHP versions simultaneously
<?php function safe_func(array $variable) { return count($vairable) > 1; } function unsafe_func(array $variable) { return empty($varialbe); } var_dump(unsafe_func([1,2,3]), safe_func([1,2,3]));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/GKkJe
function name:  (null)
number of ops:  11
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   INIT_FCALL                                               'var_dump'
          1        INIT_FCALL                                               'unsafe_func'
          2        SEND_VAL                                                 <array>
          3        DO_FCALL                                      0  $0      
          4        SEND_VAR                                                 $0
          5        INIT_FCALL                                               'safe_func'
          6        SEND_VAL                                                 <array>
          7        DO_FCALL                                      0  $1      
          8        SEND_VAR                                                 $1
          9        DO_ICALL                                                 
         10      > RETURN                                                   1

Function safe_func:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/GKkJe
function name:  safe_func
number of ops:  5
compiled vars:  !0 = $variable, !1 = $vairable
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
    3     1        COUNT                                            ~2      !1
          2        IS_SMALLER                                       ~3      1, ~2
          3      > RETURN                                                   ~3
    4     4*     > RETURN                                                   null

End of function safe_func

Function unsafe_func:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/GKkJe
function name:  unsafe_func
number of ops:  4
compiled vars:  !0 = $variable, !1 = $varialbe
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
    7     1        ISSET_ISEMPTY_CV                                 ~2      !1
          2      > RETURN                                                   ~2
    8     3*     > RETURN                                                   null

End of function unsafe_func

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
144.73 ms | 1402 KiB | 17 Q