3v4l.org

run code in 300+ PHP versions simultaneously
<?php class MyClass { public function instanceMethod() { return 'MyClass::instanceMethod called'; } } $methodName = 'instanceMethod'; $obj = new MyClass(); var_dump($obj->$methodName());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ch27M
function name:  (null)
number of ops:  10
compiled vars:  !0 = $methodName, !1 = $obj
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   ASSIGN                                                   !0, 'instanceMethod'
   10     1        NEW                                              $3      'MyClass'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !1, $3
   11     4        INIT_FCALL                                               'var_dump'
          5        INIT_METHOD_CALL                                         !1, !0
          6        DO_FCALL                                      0  $6      
          7        SEND_VAR                                                 $6
          8        DO_ICALL                                                 
          9      > RETURN                                                   1

Class MyClass:
Function instancemethod:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ch27M
function name:  instanceMethod
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E > > RETURN                                                   'MyClass%3A%3AinstanceMethod+called'
    5     1*     > RETURN                                                   null

End of function instancemethod

End of class MyClass.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
127.38 ms | 1450 KiB | 14 Q