3v4l.org

run code in 300+ PHP versions simultaneously
<?php function foo() { global $color; include 'vars.php'; echo "A $color $fruit"; } /* vars.php is in the scope of foo() so * * $fruit is NOT available outside of this * * scope. $color is because we declared it * * as global. */ foo(); // A green apple echo "A $color $fruit"; // A green ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4KvaP
function name:  (null)
number of ops:  8
compiled vars:  !0 = $color, !1 = $fruit
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   INIT_FCALL                                               'foo'
          1        DO_FCALL                                      0          
   18     2        ROPE_INIT                                     4  ~4      'A+'
          3        ROPE_ADD                                      1  ~4      ~4, !0
          4        ROPE_ADD                                      2  ~4      ~4, '+'
          5        ROPE_END                                      3  ~3      ~4, !1
          6        ECHO                                                     ~3
   20     7      > RETURN                                                   1

Function foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4KvaP
function name:  foo
number of ops:  8
compiled vars:  !0 = $color, !1 = $fruit
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   BIND_GLOBAL                                              !0, 'color'
    7     1        INCLUDE_OR_EVAL                                          'vars.php', INCLUDE
    9     2        ROPE_INIT                                     4  ~4      'A+'
          3        ROPE_ADD                                      1  ~4      ~4, !0
          4        ROPE_ADD                                      2  ~4      ~4, '+'
          5        ROPE_END                                      3  ~3      ~4, !1
          6        ECHO                                                     ~3
   10     7      > RETURN                                                   null

End of function foo

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.58 ms | 1397 KiB | 14 Q