3v4l.org

run code in 300+ PHP versions simultaneously
<?php abstract class parentCl { protected function parentMethod($arg) { echo "parent call $arg", PHP_EOL; } } class childCl extends parentCl { public function __construct() { echo "construct", PHP_EOL; } protected function childMethod($params) { echo "child call", PHP_EOL; } protected function childMethod2($params) { echo "child call2", PHP_EOL; } public function __call($name, $args) { call_user_func([$this, $name], ...$args); call_user_func([$this, 'parentMethod'], ...$args); } } //like this case, $n = new childCl(); $n->childMethod(123); $n->childMethod2(1234);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/aEc2O
function name:  (null)
number of ops:  10
compiled vars:  !0 = $n
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   35     0  E >   NEW                                              $1      'childCl'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   36     3        INIT_METHOD_CALL                                         !0, 'childMethod'
          4        SEND_VAL_EX                                              123
          5        DO_FCALL                                      0          
   37     6        INIT_METHOD_CALL                                         !0, 'childMethod2'
          7        SEND_VAL_EX                                              1234
          8        DO_FCALL                                      0          
          9      > RETURN                                                   1

Class parentCl:
Function parentmethod:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/aEc2O
function name:  parentMethod
number of ops:  6
compiled vars:  !0 = $arg
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
    7     1        NOP                                                      
          2        FAST_CONCAT                                      ~1      'parent+call+', !0
          3        ECHO                                                     ~1
          4        ECHO                                                     '%0A'
    8     5      > RETURN                                                   null

End of function parentmethod

End of class parentCl.

Class childCl:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/aEc2O
function name:  __construct
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   ECHO                                                     'construct'
          1        ECHO                                                     '%0A'
   15     2      > RETURN                                                   null

End of function __construct

Function childmethod:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/aEc2O
function name:  childMethod
number of ops:  4
compiled vars:  !0 = $params
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   RECV                                             !0      
   19     1        ECHO                                                     'child+call'
          2        ECHO                                                     '%0A'
   20     3      > RETURN                                                   null

End of function childmethod

Function childmethod2:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/aEc2O
function name:  childMethod2
number of ops:  4
compiled vars:  !0 = $params
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   22     0  E >   RECV                                             !0      
   24     1        ECHO                                                     'child+call2'
          2        ECHO                                                     '%0A'
   25     3      > RETURN                                                   null

End of function childmethod2

Function __call:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/aEc2O
function name:  __call
number of ops:  19
compiled vars:  !0 = $name, !1 = $args
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   27     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   28     2        INIT_FCALL                                               'call_user_func'
          3        FETCH_THIS                                       ~2      
          4        INIT_ARRAY                                       ~3      ~2
          5        ADD_ARRAY_ELEMENT                                ~3      !0
          6        SEND_VAL                                                 ~3
          7        SEND_UNPACK                                              !1
          8        CHECK_UNDEF_ARGS                                         
          9        DO_ICALL                                                 
   29    10        INIT_FCALL                                               'call_user_func'
         11        FETCH_THIS                                       ~5      
         12        INIT_ARRAY                                       ~6      ~5
         13        ADD_ARRAY_ELEMENT                                ~6      'parentMethod'
         14        SEND_VAL                                                 ~6
         15        SEND_UNPACK                                              !1
         16        CHECK_UNDEF_ARGS                                         
         17        DO_ICALL                                                 
   30    18      > RETURN                                                   null

End of function __call

Function parentmethod:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/aEc2O
function name:  parentMethod
number of ops:  6
compiled vars:  !0 = $arg
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
    7     1        NOP                                                      
          2        FAST_CONCAT                                      ~1      'parent+call+', !0
          3        ECHO                                                     ~1
          4        ECHO                                                     '%0A'
    8     5      > RETURN                                                   null

End of function parentmethod

End of class childCl.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
279.25 ms | 1015 KiB | 14 Q