3v4l.org

run code in 300+ PHP versions simultaneously
<?php define("CONSTANT", ...[&$test]); function func($val = CONSTANT) { var_dump($val); } function reffunc(&$val = CONSTANT) { var_dump($val); } func(); reffunc(); $test = 1; func(); reffunc();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/NYHRf
function name:  (null)
number of ops:  16
compiled vars:  !0 = $test
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'define'
          1        SEND_VAL                                                 'CONSTANT'
          2        INIT_ARRAY                                       ~1      !0
          3        SEND_UNPACK                                              ~1
          4        CHECK_UNDEF_ARGS                                         
          5        DO_ICALL                                                 
   13     6        INIT_FCALL                                               'func'
          7        DO_FCALL                                      0          
   14     8        INIT_FCALL                                               'reffunc'
          9        DO_FCALL                                      0          
   15    10        ASSIGN                                                   !0, 1
   16    11        INIT_FCALL                                               'func'
         12        DO_FCALL                                      0          
   17    13        INIT_FCALL                                               'reffunc'
         14        DO_FCALL                                      0          
         15      > RETURN                                                   1

Function func:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/NYHRf
function name:  func
number of ops:  5
compiled vars:  !0 = $val
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV_INIT                                        !0      <const ast>
    6     1        INIT_FCALL                                               'var_dump'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                                 
    7     4      > RETURN                                                   null

End of function func

Function reffunc:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/NYHRf
function name:  reffunc
number of ops:  5
compiled vars:  !0 = $val
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   RECV_INIT                                        !0      <const ast>
   10     1        INIT_FCALL                                               'var_dump'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                                 
   11     4      > RETURN                                                   null

End of function reffunc

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
163.38 ms | 1399 KiB | 21 Q