3v4l.org

run code in 300+ PHP versions simultaneously
<?php function test_call($first, &$a) { echo '<div>here</div>'; } function test_warning($args) { $test_call = 'test_call'; $test_call( ...$args ); // this line works $args[ 0 ] = 1; $test_call( ...$args ); // this line causes error } class TestWarningClass{ function __construct() { $args = array( 1, &$this ); test_warning($args); } } $test = new TestWarningClass;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/MDLLi
function name:  (null)
number of ops:  4
compiled vars:  !0 = $test
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   NEW                                              $1      'TestWarningClass'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   19     3      > RETURN                                                   1

Function test_call:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/MDLLi
function name:  test_call
number of ops:  4
compiled vars:  !0 = $first, !1 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    4     2        ECHO                                                     '%3Cdiv%3Ehere%3C%2Fdiv%3E'
    5     3      > RETURN                                                   null

End of function test_call

Function test_warning:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/MDLLi
function name:  test_warning
number of ops:  13
compiled vars:  !0 = $args, !1 = $test_call
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
    7     1        ASSIGN                                                   !1, 'test_call'
    8     2        INIT_DYNAMIC_CALL                                        !1
          3        SEND_UNPACK                                              !0
          4        CHECK_UNDEF_ARGS                                         
          5        DO_FCALL                                      1          
    9     6        ASSIGN_DIM                                               !0, 0
          7        OP_DATA                                                  1
   10     8        INIT_DYNAMIC_CALL                                        !1
          9        SEND_UNPACK                                              !0
         10        CHECK_UNDEF_ARGS                                         
         11        DO_FCALL                                      1          
   11    12      > RETURN                                                   null

End of function test_warning

Class TestWarningClass:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/MDLLi
function name:  __construct
number of ops:  8
compiled vars:  !0 = $args
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   INIT_ARRAY                                       ~1      1
          1        FETCH_THIS                                       $2      
          2        ADD_ARRAY_ELEMENT                                ~1      $2
          3        ASSIGN                                                   !0, ~1
   15     4        INIT_FCALL                                               'test_warning'
          5        SEND_VAR                                                 !0
          6        DO_FCALL                                      0          
   16     7      > RETURN                                                   null

End of function __construct

End of class TestWarningClass.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.97 ms | 1403 KiB | 14 Q