3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test { public $method; public function testA() { } public function callIt() { $method = $this->method; $method(); } } $t = new Test(); $t->method = $t->testA; var_dump($t->callIt()); die;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 79) Position 1 = -2
filename:       /in/aotX1
function name:  (null)
number of ops:  13
compiled vars:  !0 = $t
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   NEW                                              $1      'Test'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   18     3        FETCH_OBJ_R                                      ~5      !0, 'testA'
          4        ASSIGN_OBJ                                               !0, 'method'
          5        OP_DATA                                                  ~5
   20     6        INIT_FCALL                                               'var_dump'
          7        INIT_METHOD_CALL                                         !0, 'callIt'
          8        DO_FCALL                                      0  $6      
          9        SEND_VAR                                                 $6
         10        DO_ICALL                                                 
   21    11      > EXIT                                                     
         12*     > RETURN                                                   1

Class Test:
Function testa:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/aotX1
function name:  testA
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E > > RETURN                                                   null

End of function testa

Function callit:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/aotX1
function name:  callIt
number of ops:  5
compiled vars:  !0 = $method
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   FETCH_OBJ_R                                      ~1      'method'
          1        ASSIGN                                                   !0, ~1
   12     2        INIT_DYNAMIC_CALL                                        !0
          3        DO_FCALL                                      0          
   13     4      > RETURN                                                   null

End of function callit

End of class Test.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
142.16 ms | 1395 KiB | 15 Q