3v4l.org

run code in 300+ PHP versions simultaneously
<?php function foo() { $a = 1; if ($a === 1) { $a = rand(0,1) ? 1 : 0; } if ($a === 1) { var_dump("hit"); } } foo(); foo(); foo(); foo(); foo();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/9eTXd
function name:  (null)
number of ops:  11
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   INIT_FCALL                                               'foo'
          1        DO_FCALL                                      0          
   19     2        INIT_FCALL                                               'foo'
          3        DO_FCALL                                      0          
   20     4        INIT_FCALL                                               'foo'
          5        DO_FCALL                                      0          
   21     6        INIT_FCALL                                               'foo'
          7        DO_FCALL                                      0          
   22     8        INIT_FCALL                                               'foo'
          9        DO_FCALL                                      0          
         10      > RETURN                                                   1

Function foo:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 12
Branch analysis from position: 3
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 10
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 11
Branch analysis from position: 11
2 jumps found. (Code = 43) Position 1 = 14, Position 2 = 17
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 17
Branch analysis from position: 10
2 jumps found. (Code = 43) Position 1 = 14, Position 2 = 17
Branch analysis from position: 14
Branch analysis from position: 17
Branch analysis from position: 12
filename:       /in/9eTXd
function name:  foo
number of ops:  18
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   ASSIGN                                                   !0, 1
    8     1        IS_IDENTICAL                                             !0, 1
          2      > JMPZ                                                     ~2, ->12
    9     3    >   INIT_FCALL                                               'rand'
          4        SEND_VAL                                                 0
          5        SEND_VAL                                                 1
          6        DO_ICALL                                         $3      
          7      > JMPZ                                                     $3, ->10
          8    >   QM_ASSIGN                                        ~4      1
          9      > JMP                                                      ->11
         10    >   QM_ASSIGN                                        ~4      0
         11    >   ASSIGN                                                   !0, ~4
   12    12    >   IS_IDENTICAL                                             !0, 1
         13      > JMPZ                                                     ~6, ->17
   13    14    >   INIT_FCALL                                               'var_dump'
         15        SEND_VAL                                                 'hit'
         16        DO_ICALL                                                 
   15    17    > > RETURN                                                   null

End of function foo

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.53 ms | 1018 KiB | 20 Q