3v4l.org

run code in 300+ PHP versions simultaneously
<?php function modify(&$x) { $x = 50; } function &get_reference() { global $x; return $x; } $x = 42; var_dump($x); modify(get_reference()); var_dump($x); print "======" . PHP_EOL; $x = 42; var_dump($x); modify((get_reference())); // brackets var_dump($x); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/RTJsk
function name:  (null)
number of ops:  26
compiled vars:  !0 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   ASSIGN                                                   !0, 42
   12     1        INIT_FCALL                                               'var_dump'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                                 
   13     4        INIT_FCALL                                               'modify'
          5        INIT_FCALL                                               'get_reference'
          6        DO_FCALL                                      0  $3      
          7        SEND_VAR_NO_REF                               0          $3
          8        DO_FCALL                                      0          
   14     9        INIT_FCALL                                               'var_dump'
         10        SEND_VAR                                                 !0
         11        DO_ICALL                                                 
   15    12        ECHO                                                     '%3D%3D%3D%3D%3D%3D%0A'
   16    13        ASSIGN                                                   !0, 42
   17    14        INIT_FCALL                                               'var_dump'
         15        SEND_VAR                                                 !0
         16        DO_ICALL                                                 
   18    17        INIT_FCALL                                               'modify'
         18        INIT_FCALL                                               'get_reference'
         19        DO_FCALL                                      0  $8      
         20        SEND_VAR_NO_REF                               0          $8
         21        DO_FCALL                                      0          
   19    22        INIT_FCALL                                               'var_dump'
         23        SEND_VAR                                                 !0
         24        DO_ICALL                                                 
   20    25      > RETURN                                                   1

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

End of function modify

Function get_reference:
Finding entry points
Branch analysis from position: 0
Return found
filename:       /in/RTJsk
function name:  get_reference
number of ops:  3
compiled vars:  !0 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   BIND_GLOBAL                                              !0, 'x'
    8     1      > RETURN_BY_REF                                            !0
    9     2*     > RETURN_BY_REF                                            null

End of function get_reference

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
175.1 ms | 944 KiB | 20 Q