3v4l.org

run code in 300+ PHP versions simultaneously
<?php class ParentClass{ protected function run(){} public function __call($method,$arguments) { echo "<br/>######Call ". get_called_class()."########<br>"; if(method_exists($this, $method)) { call_user_func_array(array($this,$method),$arguments); } } } class first_child extends ParentClass{ protected function run(){ echo "<br>running " . get_called_class(); $x= new second_child; $x->run(); } } class second_child extends ParentClass{ protected function run(){ echo "<br>running " . get_called_class(); } } $y= new first_child; $y->run();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/lYIEk
function name:  (null)
number of ops:  6
compiled vars:  !0 = $y
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   38     0  E >   NEW                                              $1      'first_child'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   39     3        INIT_METHOD_CALL                                         !0, 'run'
          4        DO_FCALL                                      0          
          5      > RETURN                                                   1

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

End of function run

Function __call:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 12, Position 2 = 19
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 19
filename:       /in/lYIEk
function name:  __call
number of ops:  20
compiled vars:  !0 = $method, !1 = $arguments
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    9     2        GET_CALLED_CLASS                                 ~2      
          3        CONCAT                                           ~3      '%3Cbr%2F%3E%23%23%23%23%23%23Call+', ~2
          4        CONCAT                                           ~4      ~3, '%23%23%23%23%23%23%23%23%3Cbr%3E'
          5        ECHO                                                     ~4
   10     6        INIT_FCALL                                               'method_exists'
          7        FETCH_THIS                                       ~5      
          8        SEND_VAL                                                 ~5
          9        SEND_VAR                                                 !0
         10        DO_ICALL                                         $6      
         11      > JMPZ                                                     $6, ->19
   12    12    >   FETCH_THIS                                       ~7      
         13        INIT_ARRAY                                       ~8      ~7
         14        ADD_ARRAY_ELEMENT                                ~8      !0
         15        INIT_USER_CALL                                0          'call_user_func_array', ~8
         16        SEND_ARRAY                                               !1
         17        CHECK_UNDEF_ARGS                                         
         18        DO_FCALL                                      0          
   14    19    > > RETURN                                                   null

End of function __call

End of class ParentClass.

Class first_child:
Function run:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/lYIEk
function name:  run
number of ops:  9
compiled vars:  !0 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   21     0  E >   GET_CALLED_CLASS                                 ~1      
          1        CONCAT                                           ~2      '%3Cbr%3Erunning+', ~1
          2        ECHO                                                     ~2
   22     3        NEW                                              $3      'second_child'
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !0, $3
   23     6        INIT_METHOD_CALL                                         !0, 'run'
          7        DO_FCALL                                      0          
   24     8      > RETURN                                                   null

End of function run

Function __call:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 12, Position 2 = 19
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 19
filename:       /in/lYIEk
function name:  __call
number of ops:  20
compiled vars:  !0 = $method, !1 = $arguments
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    9     2        GET_CALLED_CLASS                                 ~2      
          3        CONCAT                                           ~3      '%3Cbr%2F%3E%23%23%23%23%23%23Call+', ~2
          4        CONCAT                                           ~4      ~3, '%23%23%23%23%23%23%23%23%3Cbr%3E'
          5        ECHO                                                     ~4
   10     6        INIT_FCALL                                               'method_exists'
          7        FETCH_THIS                                       ~5      
          8        SEND_VAL                                                 ~5
          9        SEND_VAR                                                 !0
         10        DO_ICALL                                         $6      
         11      > JMPZ                                                     $6, ->19
   12    12    >   FETCH_THIS                                       ~7      
         13        INIT_ARRAY                                       ~8      ~7
         14        ADD_ARRAY_ELEMENT                                ~8      !0
         15        INIT_USER_CALL                                0          'call_user_func_array', ~8
         16        SEND_ARRAY                                               !1
         17        CHECK_UNDEF_ARGS                                         
         18        DO_FCALL                                      0          
   14    19    > > RETURN                                                   null

End of function __call

End of class first_child.

Class second_child:
Function run:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/lYIEk
function name:  run
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   31     0  E >   GET_CALLED_CLASS                                 ~0      
          1        CONCAT                                           ~1      '%3Cbr%3Erunning+', ~0
          2        ECHO                                                     ~1
   33     3      > RETURN                                                   null

End of function run

Function __call:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 12, Position 2 = 19
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 19
filename:       /in/lYIEk
function name:  __call
number of ops:  20
compiled vars:  !0 = $method, !1 = $arguments
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    9     2        GET_CALLED_CLASS                                 ~2      
          3        CONCAT                                           ~3      '%3Cbr%2F%3E%23%23%23%23%23%23Call+', ~2
          4        CONCAT                                           ~4      ~3, '%23%23%23%23%23%23%23%23%3Cbr%3E'
          5        ECHO                                                     ~4
   10     6        INIT_FCALL                                               'method_exists'
          7        FETCH_THIS                                       ~5      
          8        SEND_VAL                                                 ~5
          9        SEND_VAR                                                 !0
         10        DO_ICALL                                         $6      
         11      > JMPZ                                                     $6, ->19
   12    12    >   FETCH_THIS                                       ~7      
         13        INIT_ARRAY                                       ~8      ~7
         14        ADD_ARRAY_ELEMENT                                ~8      !0
         15        INIT_USER_CALL                                0          'call_user_func_array', ~8
         16        SEND_ARRAY                                               !1
         17        CHECK_UNDEF_ARGS                                         
         18        DO_FCALL                                      0          
   14    19    > > RETURN                                                   null

End of function __call

End of class second_child.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.73 ms | 1409 KiB | 15 Q