3v4l.org

run code in 300+ PHP versions simultaneously
<?php $x = 1; function test() { static $x; if ($x++ == 1) echo "Ruddy "; echo "Bloody "; echo "Brilliant "; return $x; } test(); $x++; test();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/lZZ3I
function name:  (null)
number of ops:  7
compiled vars:  !0 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 1
   17     1        INIT_FCALL                                               'test'
          2        DO_FCALL                                      0          
   18     3        PRE_INC                                                  !0
   19     4        INIT_FCALL                                               'test'
          5        DO_FCALL                                      0          
          6      > RETURN                                                   1

Function test:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 5
Branch analysis from position: 4
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 5
filename:       /in/lZZ3I
function name:  test
number of ops:  9
compiled vars:  !0 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   BIND_STATIC                                              !0
    9     1        POST_INC                                         ~1      !0
          2        IS_EQUAL                                                 ~1, 1
          3      > JMPZ                                                     ~2, ->5
   10     4    >   ECHO                                                     'Ruddy+'
   11     5    >   ECHO                                                     'Bloody+'
   12     6        ECHO                                                     'Brilliant+'
   14     7      > RETURN                                                   !0
   15     8*     > RETURN                                                   null

End of function test

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
147.37 ms | 1389 KiB | 15 Q