3v4l.org

run code in 300+ PHP versions simultaneously
<?php function f() { global $x; echo "f() before: $x\n"; $x = $x + 10; echo "f() after: $x\n"; return 1; } $x = 0; echo "file before: $x\n"; $x = $x + f(); echo "file after: $x\n";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/9sNim
function name:  (null)
number of ops:  14
compiled vars:  !0 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   ASSIGN                                                   !0, 0
   10     1        ROPE_INIT                                     3  ~3      'file+before%3A+'
          2        ROPE_ADD                                      1  ~3      ~3, !0
          3        ROPE_END                                      2  ~2      ~3, '%0A'
          4        ECHO                                                     ~2
   11     5        INIT_FCALL                                               'f'
          6        DO_FCALL                                      0  $5      
          7        ADD                                              ~6      !0, $5
          8        ASSIGN                                                   !0, ~6
   12     9        ROPE_INIT                                     3  ~9      'file+after%3A+'
         10        ROPE_ADD                                      1  ~9      ~9, !0
         11        ROPE_END                                      2  ~8      ~9, '%0A'
         12        ECHO                                                     ~8
         13      > RETURN                                                   1

Function f:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/9sNim
function name:  f
number of ops:  13
compiled vars:  !0 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   BIND_GLOBAL                                              !0, 'x'
    4     1        ROPE_INIT                                     3  ~2      'f%28%29+before%3A+'
          2        ROPE_ADD                                      1  ~2      ~2, !0
          3        ROPE_END                                      2  ~1      ~2, '%0A'
          4        ECHO                                                     ~1
    5     5        ADD                                              ~4      !0, 10
          6        ASSIGN                                                   !0, ~4
    6     7        ROPE_INIT                                     3  ~7      'f%28%29+after%3A+'
          8        ROPE_ADD                                      1  ~7      ~7, !0
          9        ROPE_END                                      2  ~6      ~7, '%0A'
         10        ECHO                                                     ~6
    7    11      > RETURN                                                   1
    8    12*     > RETURN                                                   null

End of function f

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
177.63 ms | 1397 KiB | 14 Q