3v4l.org

run code in 300+ PHP versions simultaneously
<?php function byVal($arg) { echo 'As passed : ', var_export(func_get_args()), PHP_EOL; $arg = 'baz'; echo 'After change : ', var_export(func_get_args()), PHP_EOL; } function byRef(&$arg) { echo 'As passed : ', var_export(func_get_args()), PHP_EOL; $arg = 'baz'; echo 'After change : ', var_export(func_get_args()), PHP_EOL; } $arg = 'bar'; byVal($arg); byRef($arg); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/NhvOW
function name:  (null)
number of ops:  8
compiled vars:  !0 = $arg
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   ASSIGN                                                   !0, 'bar'
   15     1        INIT_FCALL                                               'byval'
          2        SEND_VAR                                                 !0
          3        DO_FCALL                                      0          
   16     4        INIT_FCALL                                               'byref'
          5        SEND_REF                                                 !0
          6        DO_FCALL                                      0          
   17     7      > RETURN                                                   1

Function byval:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/NhvOW
function name:  byVal
number of ops:  17
compiled vars:  !0 = $arg
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
    3     1        ECHO                                                     'As+passed+++++%3A+'
          2        INIT_FCALL                                               'var_export'
          3        FUNC_GET_ARGS                                    ~1      
          4        SEND_VAL                                                 ~1
          5        DO_ICALL                                         $2      
          6        ECHO                                                     $2
          7        ECHO                                                     '%0A'
    4     8        ASSIGN                                                   !0, 'baz'
    5     9        ECHO                                                     'After+change++%3A+'
         10        INIT_FCALL                                               'var_export'
         11        FUNC_GET_ARGS                                    ~4      
         12        SEND_VAL                                                 ~4
         13        DO_ICALL                                         $5      
         14        ECHO                                                     $5
         15        ECHO                                                     '%0A'
    6    16      > RETURN                                                   null

End of function byval

Function byref:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/NhvOW
function name:  byRef
number of ops:  17
compiled vars:  !0 = $arg
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   RECV                                             !0      
    9     1        ECHO                                                     'As+passed+++++%3A+'
          2        INIT_FCALL                                               'var_export'
          3        FUNC_GET_ARGS                                    ~1      
          4        SEND_VAL                                                 ~1
          5        DO_ICALL                                         $2      
          6        ECHO                                                     $2
          7        ECHO                                                     '%0A'
   10     8        ASSIGN                                                   !0, 'baz'
   11     9        ECHO                                                     'After+change++%3A+'
         10        INIT_FCALL                                               'var_export'
         11        FUNC_GET_ARGS                                    ~4      
         12        SEND_VAL                                                 ~4
         13        DO_ICALL                                         $5      
         14        ECHO                                                     $5
         15        ECHO                                                     '%0A'
   12    16      > RETURN                                                   null

End of function byref

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
166.06 ms | 1402 KiB | 17 Q