3v4l.org

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

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

End of function test

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
171.97 ms | 3281 KiB | 15 Q