3v4l.org

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

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

End of function sayhelloworld

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/m3KlP
function name:  getWorld
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   FETCH_OBJ_R                                      ~0      'world'
          1      > RETURN                                                   ~0
   13     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/m3KlP
function name:  setWorld
number of ops:  4
compiled vars:  !0 = $val
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   RECV                                             !0      
   15     1        ASSIGN_OBJ                                               'world'
          2        OP_DATA                                                  !0
   16     3      > RETURN                                                   null

End of function setworld

End of class MyHelloWorld.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
146.88 ms | 1399 KiB | 13 Q