3v4l.org

run code in 300+ PHP versions simultaneously
<?php class test { static $p = "some property"; } echo test::$p; final class valueobject { private $prop; function __construct() { $this->prop = test::p; } function getProp(){ return $this->prop; } } $vo = new valueobject; var_dump($vo); echo $vo->getProp(),"\n";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ds8se
function name:  (null)
number of ops:  13
compiled vars:  !0 = $vo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   FETCH_STATIC_PROP_R          unknown             ~1      'p'
          1        ECHO                                                     ~1
   18     2        NEW                                              $2      'valueobject'
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !0, $2
   19     5        INIT_FCALL                                               'var_dump'
          6        SEND_VAR                                                 !0
          7        DO_ICALL                                                 
   20     8        INIT_METHOD_CALL                                         !0, 'getProp'
          9        DO_FCALL                                      0  $6      
         10        ECHO                                                     $6
         11        ECHO                                                     '%0A'
         12      > RETURN                                                   1

Class test: [no user functions]
Class valueobject:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ds8se
function name:  __construct
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   FETCH_CLASS_CONSTANT                             ~1      'test', 'p'
          1        ASSIGN_OBJ                                               'prop'
          2        OP_DATA                                                  ~1
   12     3      > RETURN                                                   null

End of function __construct

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

End of function getprop

End of class valueobject.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
175.25 ms | 1400 KiB | 15 Q