3v4l.org

run code in 500+ PHP versions simultaneously
<?php function foo() { $a = 1; if ($a === 1) { $a = rand(0,1) ? 1 : 0; 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/qETF5
function name:  (null)
number of ops:  11
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   15     0  E >   INIT_FCALL                                                   'foo'
          1        DO_FCALL                                          0          
   16     2        INIT_FCALL                                                   'foo'
          3        DO_FCALL                                          0          
   17     4        INIT_FCALL                                                   'foo'
          5        DO_FCALL                                          0          
   18     6        INIT_FCALL                                                   'foo'
          7        DO_FCALL                                          0          
   19     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 = 15
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
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
filename:       /in/qETF5
function name:  foo
number of ops:  16
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, ->15
    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
   10    12        INIT_FCALL                                                   'var_dump'
         13        SEND_VAL                                                     'hit'
         14        DO_ICALL                                                     
   12    15    > > RETURN                                                       null

End of function foo

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
162.45 ms | 1403 KiB | 20 Q