3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { public static $static_prop = 'class prop'; public $prop = 'object prop'; static function printClassProp() { //print 'prefix ' . self::$static_prop . ' postfix' . PHP_EOL; print "prefix {\self::$static_prop} postfix" . PHP_EOL; // <-- issue here } function printObjectProp() { print "prefix {$this->prop} postfix" . PHP_EOL; } } $foo = new Foo; $foo->printObjectProp(); Foo::printClassProp();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Brt0D
function name:  (null)
number of ops:  8
compiled vars:  !0 = $foo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   NEW                                              $1      'Foo'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   20     3        INIT_METHOD_CALL                                         !0, 'printObjectProp'
          4        DO_FCALL                                      0          
   23     5        INIT_STATIC_METHOD_CALL                                  'Foo', 'printClassProp'
          6        DO_FCALL                                      0          
          7      > RETURN                                                   1

Class Foo:
Function printclassprop:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Brt0D
function name:  printClassProp
number of ops:  6
compiled vars:  !0 = $static_prop
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   ROPE_INIT                                     3  ~2      'prefix+%7B%5Cself%3A%3A'
          1        ROPE_ADD                                      1  ~2      ~2, !0
          2        ROPE_END                                      2  ~1      ~2, '%7D+postfix'
          3        CONCAT                                           ~4      ~1, '%0A'
          4        ECHO                                                     ~4
   11     5      > RETURN                                                   null

End of function printclassprop

Function printobjectprop:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Brt0D
function name:  printObjectProp
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   ROPE_INIT                                     3  ~2      'prefix+'
          1        FETCH_OBJ_R                                      ~0      'prop'
          2        ROPE_ADD                                      1  ~2      ~2, ~0
          3        ROPE_END                                      2  ~1      ~2, '+postfix'
          4        CONCAT                                           ~4      ~1, '%0A'
          5        ECHO                                                     ~4
   15     6      > RETURN                                                   null

End of function printobjectprop

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
162.12 ms | 1394 KiB | 13 Q