3v4l.org

run code in 300+ PHP versions simultaneously
<?php function test() { static $x; if ($x++ == 1) { echo "Ruddy\n"; } echo "Bloody\n"; echo "Brilliant\n"; echo "\n"; return $x; } test(); test();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/sEKcl
function name:  (null)
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   INIT_FCALL                                               'test'
          1        DO_FCALL                                      0          
   19     2        INIT_FCALL                                               'test'
          3        DO_FCALL                                      0          
          4      > 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/sEKcl
function name:  test
number of ops:  10
compiled vars:  !0 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   BIND_STATIC                                              !0
    8     1        POST_INC                                         ~1      !0
          2        IS_EQUAL                                                 ~1, 1
          3      > JMPZ                                                     ~2, ->5
    9     4    >   ECHO                                                     'Ruddy%0A'
   12     5    >   ECHO                                                     'Bloody%0A'
   13     6        ECHO                                                     'Brilliant%0A'
   14     7        ECHO                                                     '%0A'
   15     8      > RETURN                                                   !0
   16     9*     > RETURN                                                   null

End of function test

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.39 ms | 1397 KiB | 15 Q