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 'print_' . self::$static_prop . PHP_EOL; print "print_{self::$static_prop}" . PHP_EOL; } function printObjectProp() { print "print_{$this->prop}" . 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/uo8YI
function name:  (null)
number of ops:  8
compiled vars:  !0 = $foo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   NEW                                              $1      'Foo'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   19     3        INIT_METHOD_CALL                                         !0, 'printObjectProp'
          4        DO_FCALL                                      0          
   20     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/uo8YI
function name:  printClassProp
number of ops:  10
compiled vars:  !0 = $static_prop
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   FETCH_STATIC_PROP_R          unknown             ~1      'static_prop'
          1        CONCAT                                           ~2      'print_', ~1
          2        CONCAT                                           ~3      ~2, '%0A'
          3        ECHO                                                     ~3
   10     4        ROPE_INIT                                     3  ~5      'print_%7Bself%3A%3A'
          5        ROPE_ADD                                      1  ~5      ~5, !0
          6        ROPE_END                                      2  ~4      ~5, '%7D'
          7        CONCAT                                           ~7      ~4, '%0A'
          8        ECHO                                                     ~7
   11     9      > 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/uo8YI
function name:  printObjectProp
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   NOP                                                      
          1        FETCH_OBJ_R                                      ~0      'prop'
          2        FAST_CONCAT                                      ~1      'print_', ~0
          3        CONCAT                                           ~2      ~1, '%0A'
          4        ECHO                                                     ~2
   15     5      > RETURN                                                   null

End of function printobjectprop

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.01 ms | 1395 KiB | 13 Q