3v4l.org

run code in 500+ PHP versions simultaneously
<?php trait Hello { public function getHello(){ return 'Hello'; } public function sayHelloWorld1() { echo "{$this->getWorld()} {$this->getHello()}\n"; } abstract public function getWorld(); } trait World { public function getWorld(){ return 'World'; } public function sayHelloWorld2() { echo "{$this->getWorld()} {$this->getHello()}\n"; } abstract public function getHello(); } class MyHelloWorld { use Hello, World; public function __construct() { $this->sayHelloWorld1(); $this->sayHelloWorld2(); } } new MyHelloWorld;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/5QsHG
function name:  (null)
number of ops:  5
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   22     0  E >   DECLARE_CLASS                                                'myhelloworld'
   31     1        NEW                                                  $0      'MyHelloWorld'
          2        DO_FCALL                                          0          
          3        FREE                                                         $0
   32     4      > RETURN                                                       1

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

End of function gethello

Function sayhelloworld1:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/5QsHG
function name:  sayHelloWorld1
number of ops:  10
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    8     0  E >   INIT_METHOD_CALL                                             'getWorld'
          1        DO_FCALL                                          0  $0      
          2        ROPE_INIT                                         4  ~3      $0
          3        ROPE_ADD                                          1  ~3      ~3, '+'
          4        INIT_METHOD_CALL                                             'getHello'
          5        DO_FCALL                                          0  $1      
          6        ROPE_ADD                                          2  ~3      ~3, $1
          7        ROPE_END                                          3  ~2      ~3, '%0A'
          8        ECHO                                                         ~2
    9     9      > RETURN                                                       null

End of function sayhelloworld1

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

End of function getworld

End of class Hello.

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

End of function getworld

Function sayhelloworld2:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/5QsHG
function name:  sayHelloWorld2
number of ops:  10
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   17     0  E >   INIT_METHOD_CALL                                             'getWorld'
          1        DO_FCALL                                          0  $0      
          2        ROPE_INIT                                         4  ~3      $0
          3        ROPE_ADD                                          1  ~3      ~3, '+'
          4        INIT_METHOD_CALL                                             'getHello'
          5        DO_FCALL                                          0  $1      
          6        ROPE_ADD                                          2  ~3      ~3, $1
          7        ROPE_END                                          3  ~2      ~3, '%0A'
          8        ECHO                                                         ~2
   18     9      > RETURN                                                       null

End of function sayhelloworld2

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

End of function gethello

End of class World.

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

End of function __construct

End of class MyHelloWorld.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
225.65 ms | 2064 KiB | 13 Q