3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Dog { public function bark() { echo "Woof!"; } } $class = 'Dog' ; $action = 'bark'; $x = new $class(); // instantiates the class 'Dog' $x->$action();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/dekn8
function name:  (null)
number of ops:  9
compiled vars:  !0 = $class, !1 = $action, !2 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   ASSIGN                                                   !0, 'Dog'
   11     1        ASSIGN                                                   !1, 'bark'
   12     2        FETCH_CLASS                                   0  $5      !0
          3        NEW                                              $6      $5
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !2, $6
   13     6        INIT_METHOD_CALL                                         !2, !1
          7        DO_FCALL                                      0          
          8      > RETURN                                                   1

Class Dog:
Function bark:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/dekn8
function name:  bark
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   ECHO                                                     'Woof%21'
    7     1      > RETURN                                                   null

End of function bark

End of class Dog.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.73 ms | 1397 KiB | 13 Q