3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { public function getB() { return new B(); } } class B { public function foo($value) { return sprintf('Hello %s!', $value); } } $arrCallBack = array ( 'getB', 'foo' => array('Fridolin'), ); $mixValue = new A(); foreach ($arrCallBack as $strMethod => $arrParameterList) { if (is_array($arrParameterList) && count($arrParameterList)) { $mixValue = call_user_func_array(array($mixValue, $strMethod), $arrParameterList); } else { $mixValue = $mixValue->{$arrParameterList}(); } } var_dump($mixValue);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 5, Position 2 = 24
Branch analysis from position: 5
2 jumps found. (Code = 78) Position 1 = 6, Position 2 = 24
Branch analysis from position: 6
2 jumps found. (Code = 46) Position 1 = 9, Position 2 = 11
Branch analysis from position: 9
2 jumps found. (Code = 43) Position 1 = 12, Position 2 = 20
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 23
Branch analysis from position: 23
1 jumps found. (Code = 42) Position 1 = 5
Branch analysis from position: 5
Branch analysis from position: 20
1 jumps found. (Code = 42) Position 1 = 5
Branch analysis from position: 5
Branch analysis from position: 11
Branch analysis from position: 24
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 24
filename:       /in/Xc1Uf
function name:  (null)
number of ops:  29
compiled vars:  !0 = $arrCallBack, !1 = $mixValue, !2 = $arrParameterList, !3 = $strMethod
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   ASSIGN                                                   !0, <array>
   24     1        NEW                                              $5      'A'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !1, $5
   25     4      > FE_RESET_R                                       $8      !0, ->24
          5    > > FE_FETCH_R                                       ~9      $8, !2, ->24
          6    >   ASSIGN                                                   !3, ~9
   27     7        TYPE_CHECK                                  128  ~11     !2
          8      > JMPZ_EX                                          ~11     ~11, ->11
          9    >   COUNT                                            ~12     !2
         10        BOOL                                             ~11     ~12
         11    > > JMPZ                                                     ~11, ->20
   29    12    >   INIT_ARRAY                                       ~13     !1
         13        ADD_ARRAY_ELEMENT                                ~13     !3
         14        INIT_USER_CALL                                0          'call_user_func_array', ~13
         15        SEND_ARRAY                                               !2
         16        CHECK_UNDEF_ARGS                                         
         17        DO_FCALL                                      0  $14     
         18        ASSIGN                                                   !1, $14
         19      > JMP                                                      ->23
   33    20    >   INIT_METHOD_CALL                                         !1, !2
         21        DO_FCALL                                      0  $16     
         22        ASSIGN                                                   !1, $16
   25    23    > > JMP                                                      ->5
         24    >   FE_FREE                                                  $8
   36    25        INIT_FCALL                                               'var_dump'
         26        SEND_VAR                                                 !1
         27        DO_ICALL                                                 
         28      > RETURN                                                   1

Class A:
Function getb:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Xc1Uf
function name:  getB
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   NEW                                              $0      'B'
          1        DO_FCALL                                      0          
          2      > RETURN                                                   $0
    7     3*     > RETURN                                                   null

End of function getb

End of class A.

Class B:
Function foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Xc1Uf
function name:  foo
number of ops:  7
compiled vars:  !0 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   RECV                                             !0      
   14     1        INIT_FCALL                                               'sprintf'
          2        SEND_VAL                                                 'Hello+%25s%21'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $1      
          5      > RETURN                                                   $1
   15     6*     > RETURN                                                   null

End of function foo

End of class B.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.87 ms | 1400 KiB | 17 Q