3v4l.org

run code in 300+ PHP versions simultaneously
<?php function myTest() { $x = 5; // local scope echo "<p>Variable X inside function is: $x</p>"; } myTest(); // using x outside the function will generate an error echo "<p>Variable X outside function is: $x</p>"; ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/j789S
function name:  (null)
number of ops:  7
compiled vars:  !0 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   INIT_FCALL                                               'mytest'
          1        DO_FCALL                                      0          
    9     2        ROPE_INIT                                     3  ~3      '%3Cp%3EVariable+X+outside+function+is%3A+'
          3        ROPE_ADD                                      1  ~3      ~3, !0
          4        ROPE_END                                      2  ~2      ~3, '%3C%2Fp%3E'
          5        ECHO                                                     ~2
   10     6      > RETURN                                                   1

Function mytest:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/j789S
function name:  myTest
number of ops:  6
compiled vars:  !0 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 5
    4     1        ROPE_INIT                                     3  ~3      '%3Cp%3EVariable+X+inside+function+is%3A+'
          2        ROPE_ADD                                      1  ~3      ~3, !0
          3        ROPE_END                                      2  ~2      ~3, '%3C%2Fp%3E'
          4        ECHO                                                     ~2
    5     5      > RETURN                                                   null

End of function mytest

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
162.98 ms | 1397 KiB | 14 Q