3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { function fun() { echo "fooo"; } } $parts = ['Foo', 'fun']; $controller = array_shift($parts); $method = array_shift($parts); (new $controller)->$method();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/2Prss
function name:  (null)
number of ops:  15
compiled vars:  !0 = $parts, !1 = $controller, !2 = $method
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   ASSIGN                                                   !0, <array>
   11     1        INIT_FCALL                                               'array_shift'
          2        SEND_REF                                                 !0
          3        DO_ICALL                                         $4      
          4        ASSIGN                                                   !1, $4
   12     5        INIT_FCALL                                               'array_shift'
          6        SEND_REF                                                 !0
          7        DO_ICALL                                         $6      
          8        ASSIGN                                                   !2, $6
   13     9        FETCH_CLASS                                   0  $8      !1
         10        NEW                                              $9      $8
         11        DO_FCALL                                      0          
         12        INIT_METHOD_CALL                                         $9, !2
         13        DO_FCALL                                      0          
         14      > RETURN                                                   1

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

End of function fun

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
207.64 ms | 1395 KiB | 15 Q