3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { function fun($bar) { echo "fooo" . $bar; } } $parts = ['Foo', 'fun']; $controller = array_shift($parts); $method = array_shift($parts); call_user_func_array([new $controller, $method], $parts);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/M3KTQ
function name:  (null)
number of ops:  19
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_ARRAY                                       ~11     $9
         13        ADD_ARRAY_ELEMENT                                ~11     !2
         14        INIT_USER_CALL                                0          'call_user_func_array', ~11
         15        SEND_ARRAY                                               !0
         16        CHECK_UNDEF_ARGS                                         
         17        DO_FCALL                                      0          
         18      > RETURN                                                   1

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

End of function fun

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
168.36 ms | 1400 KiB | 15 Q