3v4l.org

run code in 300+ PHP versions simultaneously
<?php trait Test { private $bridge; public function implement() { if (is_callable([parent,'implement'])){ parent::implement(); } echo $this->foo; } } class A { private $foo = 'bar'; private $final = 1; public function __construct() { $this->implement(); } public function foo() { echo $this->bridge; } } class B extends A { use Test; private $foo = 'baz'; } new B();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/r2laC
function name:  (null)
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   36     0  E >   DECLARE_CLASS                                            'b', 'a'
   42     1        NEW                                              $0      'B'
          2        DO_FCALL                                      0          
          3        FREE                                                     $0
          4      > RETURN                                                   1

Class Test:
Function implement:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 9
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
filename:       /in/r2laC
function name:  implement
number of ops:  12
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   INIT_FCALL                                               'is_callable'
          1        FETCH_CONSTANT                                   ~0      'parent'
          2        INIT_ARRAY                                       ~1      ~0
          3        ADD_ARRAY_ELEMENT                                ~1      'implement'
          4        SEND_VAL                                                 ~1
          5        DO_ICALL                                         $2      
          6      > JMPZ                                                     $2, ->9
   11     7    >   INIT_STATIC_METHOD_CALL                                  'implement'
          8        DO_FCALL                                      0          
   14     9    >   FETCH_OBJ_R                                      ~4      'foo'
         10        ECHO                                                     ~4
   15    11      > RETURN                                                   null

End of function implement

End of class Test.

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

End of function __construct

Function foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/r2laC
function name:  foo
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   32     0  E >   FETCH_OBJ_R                                      ~0      'bridge'
          1        ECHO                                                     ~0
   33     2      > RETURN                                                   null

End of function foo

End of class A.

Class B: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.46 ms | 1396 KiB | 15 Q