3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { const K_PATH = "world"; const PDF_GO = "hello"; } class Bar { protected $Conf; public function __constructor($config) { $this->Conf = $config; } public function say(){ echo "We are the " . constant($this->Conf::K_PATH); } } $foo = new Foo(); $bar = new Bar($foo); $bar->say();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/07X97
function name:  (null)
number of ops:  10
compiled vars:  !0 = $foo, !1 = $bar
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   26     0  E >   NEW                                              $2      'Foo'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   28     3        NEW                                              $5      'Bar'
          4        SEND_VAR_EX                                              !0
          5        DO_FCALL                                      0          
          6        ASSIGN                                                   !1, $5
   30     7        INIT_METHOD_CALL                                         !1, 'say'
          8        DO_FCALL                                      0          
          9      > RETURN                                                   1

Class Foo: [no user functions]
Class Bar:
Function __constructor:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/07X97
function name:  __constructor
number of ops:  4
compiled vars:  !0 = $config
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   RECV                                             !0      
   16     1        ASSIGN_OBJ                                               'Conf'
          2        OP_DATA                                                  !0
   17     3      > RETURN                                                   null

End of function __constructor

Function say:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/07X97
function name:  say
number of ops:  9
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   INIT_FCALL                                               'constant'
          1        FETCH_OBJ_R                                      ~0      'Conf'
          2        FETCH_CLASS                                   0  $1      ~0
          3        FETCH_CLASS_CONSTANT                             ~2      $1, 'K_PATH'
          4        SEND_VAL                                                 ~2
          5        DO_ICALL                                         $3      
          6        CONCAT                                           ~4      'We+are+the+', $3
          7        ECHO                                                     ~4
   22     8      > RETURN                                                   null

End of function say

End of class Bar.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.76 ms | 1396 KiB | 15 Q