3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { public static $class_prop = 'Class_Property'; public $object_prop = 'Object_Property'; static function printClassProp() { print 'prefix_' . self::$class_prop . '_postfix' . PHP_EOL; print "prefix_{\\self::$class_prop}_postfix" . PHP_EOL; } function printObjectProp() { print "prefix_{$this->object_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/kmats
function name:  (null)
number of ops:  8
compiled vars:  !0 = $foo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   NEW                                              $1      'Foo'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   21     3        INIT_METHOD_CALL                                         !0, 'printObjectProp'
          4        DO_FCALL                                      0          
   24     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/kmats
function name:  printClassProp
number of ops:  11
compiled vars:  !0 = $class_prop
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   FETCH_STATIC_PROP_R          unknown             ~1      'class_prop'
          1        CONCAT                                           ~2      'prefix_', ~1
          2        CONCAT                                           ~3      ~2, '_postfix'
          3        CONCAT                                           ~4      ~3, '%0A'
          4        ECHO                                                     ~4
   11     5        ROPE_INIT                                     3  ~6      'prefix_%7B%5Cself%3A%3A'
          6        ROPE_ADD                                      1  ~6      ~6, !0
          7        ROPE_END                                      2  ~5      ~6, '%7D_postfix'
          8        CONCAT                                           ~8      ~5, '%0A'
          9        ECHO                                                     ~8
   12    10      > 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/kmats
function name:  printObjectProp
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   ROPE_INIT                                     3  ~2      'prefix_'
          1        FETCH_OBJ_R                                      ~0      'object_prop'
          2        ROPE_ADD                                      1  ~2      ~2, ~0
          3        ROPE_END                                      2  ~1      ~2, '_postfix'
          4        CONCAT                                           ~4      ~1, '%0A'
          5        ECHO                                                     ~4
   16     6      > RETURN                                                   null

End of function printobjectprop

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.69 ms | 1386 KiB | 13 Q