3v4l.org

run code in 300+ PHP versions simultaneously
<?php function f_test(&$obj) { $obj->prop++; echo "prop=".$obj->prop." <br>\r\n"; } class clsTest { public $prop = 0; public $arg_array = false; function meth() { if ($this->arg_array===false) $this->arg_array = array(&$this); echo 'arg_array[0] '.(($this->arg_array[0]===$this) ? ' is the same instance' : ' is not the same instance').' than $this'." <br>\r\n"; call_user_func_array('f_test', $this->arg_array); } } $oTest = new clsTest; $oTest->meth(); // OK $oTest->meth(); // ERR ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/PSGk9
function name:  (null)
number of ops:  8
compiled vars:  !0 = $oTest
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  18     0  E >   NEW                                              $1      :11
         1        DO_FCALL                                      0          
         2        QM_ASSIGN                                                !0
  19     3        INIT_METHOD_CALL                                         !0, 'meth'
         4        DO_FCALL                                      0          
  20     5        INIT_METHOD_CALL                                         !0, 'meth'
         6        DO_FCALL                                      0          
  22     7      > RETURN                                                   1

Function f_test:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/PSGk9
function name:  f_test
number of ops:  8
compiled vars:  !0 = $obj
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   3     0  E >   RECV                                             !0      
   4     1        POST_INC_OBJ                                     ~1      !0, 'prop'
         2        FREE                                                     ~1
   5     3        FETCH_OBJ_R                                      ~2      !0, 'prop'
         4        CONCAT                                           ~3      'prop%3D', ~2
         5        CONCAT                                           ~4      ~3, '+%3Cbr%3E%0D%0A'
         6        ASSIGN_OBJ                                               ~4
   6     7      > RETURN                                                   null

End of function f_test

Class clsTest:
Function meth:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 7
Branch analysis from position: 3
2 jumps found. (Code = 43) Position 1 = 12, Position 2 = 14
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 15
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
filename:       /in/PSGk9
function name:  meth
number of ops:  24
compiled vars:  none
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  12     0  E >   FETCH_OBJ_R                                      ~0      'arg_array'
         1        IS_NOT_IDENTICAL                                 ~1      ~0, <false>
         2      > JMPZ                                                     ~1, ->7
         3    >   FETCH_THIS                                       $3      
         4        INIT_ARRAY                                       ~4      $3
         5        ASSIGN_SUB                                   24          'arg_array'
         6        OP_DATA                                                  ~4
  13     7    >   FETCH_OBJ_R                                      ~5      'arg_array'
         8        FETCH_DIM_R                                      ~6      ~5, 0
         9        FETCH_THIS                                       ~7      
        10        IS_NOT_IDENTICAL                                 ~8      ~6, ~7
        11      > JMPZ                                                     ~8, ->14
        12    >   ASSIGN_BW_OR                                  0  ~9      '+is+the+same+instance'
        13      > JMP                                                      ->15
        14    >   ASSIGN_BW_OR                                  0  ~9      '+is+not+the+same+instance'
        15    >   CONCAT                                           ~10     'arg_array%5B0%5D+', ~9
        16        CONCAT                                           ~11     ~10, '+than+%24this'
        17        CONCAT                                           ~12     ~11, '++%3Cbr%3E%0D%0A'
        18        ASSIGN_OBJ                                               ~12
  14    19        INIT_FCALL                                               'f_test'
        20        FETCH_OBJ_R                                      ~13     'arg_array'
        21        SEND_ARRAY                                               ~13
        22        DO_FCALL                                      0          
  15    23      > RETURN                                                   null

End of function meth

End of class clsTest.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
14.44 ms | 902 KiB | 7 Q