3v4l.org

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

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

End of function bar

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
174.22 ms | 1394 KiB | 15 Q