3v4l.org

run code in 300+ PHP versions simultaneously
<?php error_reporting(E_ALL); trait Hello { public function sayHelloWorld() { echo 'Hello'.$this->getWorld(); } abstract public function getWorld(); } class MyHelloWorld { private $world; use Hello; public function getWorld() { return $this->world; } public function setWorld($val) { $this->world = $val; } } $o = new MyHelloWorld(); $o->setWorld(' World!'); $o->sayHelloWorld();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/K32Gb
function name:  (null)
number of ops:  13
compiled vars:  !0 = $o
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'error_reporting'
          1        SEND_VAL                                                 32767
          2        DO_ICALL                                                 
   12     3        DECLARE_CLASS                                            'myhelloworld'
   23     4        NEW                                              $2      'MyHelloWorld'
          5        DO_FCALL                                      0          
          6        ASSIGN                                                   !0, $2
   24     7        INIT_METHOD_CALL                                         !0, 'setWorld'
          8        SEND_VAL_EX                                              '+World%21'
          9        DO_FCALL                                      0          
   25    10        INIT_METHOD_CALL                                         !0, 'sayHelloWorld'
         11        DO_FCALL                                      0          
         12      > RETURN                                                   1

Class Hello:
Function sayhelloworld:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/K32Gb
function name:  sayHelloWorld
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   INIT_METHOD_CALL                                         'getWorld'
          1        DO_FCALL                                      0  $0      
          2        CONCAT                                           ~1      'Hello', $0
          3        ECHO                                                     ~1
    8     4      > RETURN                                                   null

End of function sayhelloworld

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

End of function getworld

End of class Hello.

Class MyHelloWorld:
Function getworld:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/K32Gb
function name:  getWorld
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   FETCH_OBJ_R                                      ~0      'world'
          1      > RETURN                                                   ~0
   17     2*     > RETURN                                                   null

End of function getworld

Function setworld:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/K32Gb
function name:  setWorld
number of ops:  4
compiled vars:  !0 = $val
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   RECV                                             !0      
   19     1        ASSIGN_OBJ                                               'world'
          2        OP_DATA                                                  !0
   20     3      > RETURN                                                   null

End of function setworld

End of class MyHelloWorld.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
178.83 ms | 1405 KiB | 15 Q