3v4l.org

run code in 300+ PHP versions simultaneously
<?php function foo(){ static $i = 0; return ++$i; } echo true ? foo() : foo(); echo true ? foo() : foo();
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 1, Position 2 = 5
Branch analysis from position: 1
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 14
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
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: 5
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 14
Branch analysis from position: 10
Branch analysis from position: 14
filename:       /in/jpWB2
function name:  (null)
number of ops:  19
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E > > JMPZ                                                     <true>, ->5
          1    >   INIT_FCALL                                               'foo'
          2        DO_FCALL                                      0  $0      
          3        QM_ASSIGN                                        ~1      $0
          4      > JMP                                                      ->8
          5    >   INIT_FCALL                                               'foo'
          6        DO_FCALL                                      0  $2      
          7        QM_ASSIGN                                        ~1      $2
          8    >   ECHO                                                     ~1
    5     9      > JMPZ                                                     <true>, ->14
         10    >   INIT_FCALL                                               'foo'
         11        DO_FCALL                                      0  $3      
         12        QM_ASSIGN                                        ~4      $3
         13      > JMP                                                      ->17
         14    >   INIT_FCALL                                               'foo'
         15        DO_FCALL                                      0  $5      
         16        QM_ASSIGN                                        ~4      $5
         17    >   ECHO                                                     ~4
         18      > RETURN                                                   1

Function foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/jpWB2
function name:  foo
number of ops:  4
compiled vars:  !0 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   BIND_STATIC                                              !0
          1        PRE_INC                                          ~1      !0
          2      > RETURN                                                   ~1
          3*     > RETURN                                                   null

End of function foo

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
172.12 ms | 1399 KiB | 17 Q