3v4l.org

run code in 300+ PHP versions simultaneously
<?php class PhpRefCallBugTester { public $ok = false; function __call( $name, $args ) { $old = error_reporting( E_ALL & ~E_WARNING ); call_user_func_array( array( $this, 'checkForBrokenRef' ), $args ); error_reporting( $old ); } function checkForBrokenRef( &$var ) { if ( $var ) { $this->ok = true; } } function execute() { $var = true; call_user_func_array( array( $this, 'foo' ), array( &$var ) ); } } $rcbt = new PhpRefCallBugTester; $rcbt->execute(); echo (int)$rcbt->ok;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/eaHgJ
function name:  (null)
number of ops:  9
compiled vars:  !0 = $rcbt
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   24     0  E >   NEW                                              $1      'PhpRefCallBugTester'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   25     3        INIT_METHOD_CALL                                         !0, 'execute'
          4        DO_FCALL                                      0          
   26     5        FETCH_OBJ_R                                      ~5      !0, 'ok'
          6        CAST                                          4  ~6      ~5
          7        ECHO                                                     ~6
          8      > RETURN                                                   1

Class PhpRefCallBugTester:
Function __call:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/eaHgJ
function name:  __call
number of ops:  17
compiled vars:  !0 = $name, !1 = $args, !2 = $old
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    6     2        INIT_FCALL                                               'error_reporting'
          3        SEND_VAL                                                 32765
          4        DO_ICALL                                         $3      
          5        ASSIGN                                                   !2, $3
    7     6        FETCH_THIS                                       ~5      
          7        INIT_ARRAY                                       ~6      ~5
          8        ADD_ARRAY_ELEMENT                                ~6      'checkForBrokenRef'
          9        INIT_USER_CALL                                0          'call_user_func_array', ~6
         10        SEND_ARRAY                                               !1
         11        CHECK_UNDEF_ARGS                                         
         12        DO_FCALL                                      0          
    8    13        INIT_FCALL                                               'error_reporting'
         14        SEND_VAR                                                 !2
         15        DO_ICALL                                                 
    9    16      > RETURN                                                   null

End of function __call

Function checkforbrokenref:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 2, Position 2 = 4
Branch analysis from position: 2
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 4
filename:       /in/eaHgJ
function name:  checkForBrokenRef
number of ops:  5
compiled vars:  !0 = $var
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   RECV                                             !0      
   12     1      > JMPZ                                                     !0, ->4
   13     2    >   ASSIGN_OBJ                                               'ok'
          3        OP_DATA                                                  <true>
   15     4    > > RETURN                                                   null

End of function checkforbrokenref

Function execute:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/eaHgJ
function name:  execute
number of ops:  10
compiled vars:  !0 = $var
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   ASSIGN                                                   !0, <true>
   19     1        FETCH_THIS                                       ~2      
          2        INIT_ARRAY                                       ~3      ~2
          3        ADD_ARRAY_ELEMENT                                ~3      'foo'
          4        INIT_USER_CALL                                0          'call_user_func_array', ~3
          5        INIT_ARRAY                                       ~4      !0
          6        SEND_ARRAY                                               ~4
          7        CHECK_UNDEF_ARGS                                         
          8        DO_FCALL                                      0          
   20     9      > RETURN                                                   null

End of function execute

End of class PhpRefCallBugTester.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.08 ms | 1392 KiB | 15 Q