3v4l.org

run code in 500+ PHP versions simultaneously
<?php trait Foo { private function sayHello() { echo "Hello!" . PHP_EOL; } } class Bar { use Foo; public function welcome() { return $this->sayHello(); } } class Baz extends Bar { public function welcome() { return $this->sayHello(); } } $bar = new Bar; $baz = new Baz; $bar->welcome(); $baz->welcome();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/keT0W
function name:  (null)
number of ops:  13
compiled vars:  !0 = $bar, !1 = $baz
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   DECLARE_CLASS                                            'bar'
   19     1        DECLARE_CLASS                                            'baz', 'bar'
   26     2        NEW                                              $2      'Bar'
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !0, $2
   27     5        NEW                                              $5      'Baz'
          6        DO_FCALL                                      0          
          7        ASSIGN                                                   !1, $5
   28     8        INIT_METHOD_CALL                                         !0, 'welcome'
          9        DO_FCALL                                      0          
   29    10        INIT_METHOD_CALL                                         !1, 'welcome'
         11        DO_FCALL                                      0          
         12      > RETURN                                                   1

Class Foo:
Function sayhello:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/keT0W
function name:  sayHello
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   ECHO                                                     'Hello%21%0A'
    7     1      > RETURN                                                   null

End of function sayhello

End of class Foo.

Class Bar:
Function welcome:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/keT0W
function name:  welcome
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   INIT_METHOD_CALL                                         'sayHello'
          1        DO_FCALL                                      0  $0      
          2      > RETURN                                                   $0
   16     3*     > RETURN                                                   null

End of function welcome

End of class Bar.

Class Baz:
Function welcome:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/keT0W
function name:  welcome
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   22     0  E >   INIT_METHOD_CALL                                         'sayHello'
          1        DO_FCALL                                      0  $0      
          2      > RETURN                                                   $0
   23     3*     > RETURN                                                   null

End of function welcome

End of class Baz.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.21 ms | 2153 KiB | 13 Q