3v4l.org

run code in 300+ PHP versions simultaneously
<?php function divide($num1, $num2) { if ($num1 == 0 || $num2 == 0) return 0; if ($num1 == '' || $num2 == '') return 0; return $num1 / $num2; } divide(1, 2); divide("", 2);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/3bnVJ
function name:  (null)
number of ops:  9
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   INIT_FCALL                                               'divide'
          1        SEND_VAL                                                 1
          2        SEND_VAL                                                 2
          3        DO_FCALL                                      0          
   13     4        INIT_FCALL                                               'divide'
          5        SEND_VAL                                                 ''
          6        SEND_VAL                                                 2
          7        DO_FCALL                                      0          
          8      > RETURN                                                   1

Function divide:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 47) Position 1 = 4, Position 2 = 6
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 8
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
2 jumps found. (Code = 47) Position 1 = 10, Position 2 = 12
Branch analysis from position: 10
2 jumps found. (Code = 43) Position 1 = 13, Position 2 = 14
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
Branch analysis from position: 6
filename:       /in/3bnVJ
function name:  divide
number of ops:  17
compiled vars:  !0 = $num1, !1 = $num2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    5     2        IS_EQUAL                                         ~2      !0, 0
          3      > JMPNZ_EX                                         ~2      ~2, ->6
          4    >   IS_EQUAL                                         ~3      !1, 0
          5        BOOL                                             ~2      ~3
          6    > > JMPZ                                                     ~2, ->8
    6     7    > > RETURN                                                   0
    7     8    >   IS_EQUAL                                         ~4      !0, ''
          9      > JMPNZ_EX                                         ~4      ~4, ->12
         10    >   IS_EQUAL                                         ~5      !1, ''
         11        BOOL                                             ~4      ~5
         12    > > JMPZ                                                     ~4, ->14
    8    13    > > RETURN                                                   0
    9    14    >   DIV                                              ~6      !0, !1
         15      > RETURN                                                   ~6
   10    16*     > RETURN                                                   null

End of function divide

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
165.46 ms | 1399 KiB | 15 Q