3v4l.org

run code in 300+ PHP versions simultaneously
<?php function foo(&$param) { $param = 42; return $param; } $a = 23; echo "\$a before calling foo(): $a\n"; $b = foo($a); echo "\$a after the call to foo(): $a\n"; $b = 23; echo "\$a after touching the returned variable: $a\n"; echo "\$b : $b\n";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/6btVl
function name:  (null)
number of ops:  23
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   ASSIGN                                                   !0, 23
    8     1        ROPE_INIT                                     3  ~4      '%24a+before+calling+foo%28%29%3A+'
          2        ROPE_ADD                                      1  ~4      ~4, !0
          3        ROPE_END                                      2  ~3      ~4, '%0A'
          4        ECHO                                                     ~3
    9     5        INIT_FCALL                                               'foo'
          6        SEND_REF                                                 !0
          7        DO_FCALL                                      0  $6      
          8        ASSIGN                                                   !1, $6
   10     9        ROPE_INIT                                     3  ~9      '%24a+after+the+call+to+foo%28%29%3A+'
         10        ROPE_ADD                                      1  ~9      ~9, !0
         11        ROPE_END                                      2  ~8      ~9, '%0A'
         12        ECHO                                                     ~8
   11    13        ASSIGN                                                   !1, 23
   12    14        ROPE_INIT                                     3  ~13     '%24a+after+touching+the+returned+variable%3A+'
         15        ROPE_ADD                                      1  ~13     ~13, !0
         16        ROPE_END                                      2  ~12     ~13, '%0A'
         17        ECHO                                                     ~12
   13    18        ROPE_INIT                                     3  ~16     '%24b+%3A+'
         19        ROPE_ADD                                      1  ~16     ~16, !1
         20        ROPE_END                                      2  ~15     ~16, '%0A'
         21        ECHO                                                     ~15
         22      > RETURN                                                   1

Function foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/6btVl
function name:  foo
number of ops:  4
compiled vars:  !0 = $param
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
    3     1        ASSIGN                                                   !0, 42
    4     2      > RETURN                                                   !0
    5     3*     > RETURN                                                   null

End of function foo

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.04 ms | 1390 KiB | 14 Q