3v4l.org

run code in 300+ PHP versions simultaneously
<?php trait x { function __call($method, $args) { return parent::__call($method, $args); } } class Foo { public function __call($methods, $args) { echo 'Foo'.PHP_EOL; } } class Bar extends Foo { use x; } $obj = new Bar(); $obj->test();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ZKStr
function name:  (null)
number of ops:  7
compiled vars:  !0 = $obj
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   DECLARE_CLASS                                            'bar', 'foo'
   24     1        NEW                                              $1      'Bar'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $1
   25     4        INIT_METHOD_CALL                                         !0, 'test'
          5        DO_FCALL                                      0          
          6      > RETURN                                                   1

Class x:
Function __call:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ZKStr
function name:  __call
number of ops:  8
compiled vars:  !0 = $method, !1 = $args
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    7     2        INIT_STATIC_METHOD_CALL                                  '__call'
          3        SEND_VAR_EX                                              !0
          4        SEND_VAR_EX                                              !1
          5        DO_FCALL                                      0  $2      
          6      > RETURN                                                   $2
    8     7*     > RETURN                                                   null

End of function __call

End of class x.

Class Foo:
Function __call:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ZKStr
function name:  __call
number of ops:  4
compiled vars:  !0 = $methods, !1 = $args
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   15     2        ECHO                                                     'Foo%0A'
   16     3      > RETURN                                                   null

End of function __call

End of class Foo.

Class Bar: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.26 ms | 1394 KiB | 13 Q