3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { const A = 'a!'; } class Bar { public $foo; public function __construct() { $this->foo = new Foo(); } } $bar = new Bar(); echo $bar->foo::A;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4Vj1N
function name:  (null)
number of ops:  8
compiled vars:  !0 = $bar
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   NEW                                              $1      'Bar'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   14     3        FETCH_OBJ_R                                      ~4      !0, 'foo'
          4        FETCH_CLASS                                   0  $5      ~4
          5        FETCH_CLASS_CONSTANT                             ~6      $5, 'A'
          6        ECHO                                                     ~6
   15     7      > RETURN                                                   1

Class Foo: [no user functions]
Class Bar:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4Vj1N
function name:  __construct
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   NEW                                              $1      'Foo'
          1        DO_FCALL                                      0          
          2        ASSIGN_OBJ                                               'foo'
          3        OP_DATA                                                  $1
   10     4      > RETURN                                                   null

End of function __construct

End of class Bar.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
138.71 ms | 996 KiB | 13 Q