3v4l.org

run code in 300+ PHP versions simultaneously
<?php Class DBConnection{ public function myMethod($a,$b){echo $a+$b;} public function callMethod($method,$arguments){ call_user_func_array([$this,$method],$arguments); } } $db = new DBConnection(); $db->callMethod("myMethod",[10,208]);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/VpJmf
function name:  (null)
number of ops:  8
compiled vars:  !0 = $db
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   NEW                                              $1      'DBConnection'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   12     3        INIT_METHOD_CALL                                         !0, 'callMethod'
          4        SEND_VAL_EX                                              'myMethod'
          5        SEND_VAL_EX                                              <array>
          6        DO_FCALL                                      0          
          7      > RETURN                                                   1

Class DBConnection:
Function mymethod:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/VpJmf
function name:  myMethod
number of ops:  5
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        ADD                                              ~2      !0, !1
          3        ECHO                                                     ~2
          4      > RETURN                                                   null

End of function mymethod

Function callmethod:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/VpJmf
function name:  callMethod
number of ops:  10
compiled vars:  !0 = $method, !1 = $arguments
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    8     2        FETCH_THIS                                       ~2      
          3        INIT_ARRAY                                       ~3      ~2
          4        ADD_ARRAY_ELEMENT                                ~3      !0
          5        INIT_USER_CALL                                0          'call_user_func_array', ~3
          6        SEND_ARRAY                                               !1
          7        CHECK_UNDEF_ARGS                                         
          8        DO_FCALL                                      0          
    9     9      > RETURN                                                   null

End of function callmethod

End of class DBConnection.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.2 ms | 940 KiB | 14 Q