3v4l.org

run code in 300+ PHP versions simultaneously
<?php class foo { public static $var_1 = 'foo_var'; public static function printStaticItem() { //echo 'Foo: ' . self::$var_1 . PHP_EOL; } public function printPHP() { echo 'PHP is great.' . PHP_EOL; } } class bar extends foo { public static $var_1 = 'static_bar_var'; public $var_2 = 'bar_var'; public static function printStaticItem() { echo 'Bar: ' . static::$var_1 . PHP_EOL; echo "Bar: {static::$static_var_1}" . PHP_EOL; } public function printItem() { echo "Bar: {$this->$var_2}" . PHP_EOL; } } $bar = new bar(); $bar->printItem(); bar::printStaticItem();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/31m0k
function name:  (null)
number of ops:  8
compiled vars:  !0 = $bar
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   32     0  E >   NEW                                              $1      'bar'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   33     3        INIT_METHOD_CALL                                         !0, 'printItem'
          4        DO_FCALL                                      0          
   35     5        INIT_STATIC_METHOD_CALL                                  'bar', 'printStaticItem'
          6        DO_FCALL                                      0          
          7      > RETURN                                                   1

Class foo:
Function printstaticitem:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/31m0k
function name:  printStaticItem
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E > > RETURN                                                   null

End of function printstaticitem

Function printphp:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/31m0k
function name:  printPHP
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   ECHO                                                     'PHP+is+great.%0A'
   13     1      > RETURN                                                   null

End of function printphp

End of class foo.

Class bar:
Function printstaticitem:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/31m0k
function name:  printStaticItem
number of ops:  10
compiled vars:  !0 = $static_var_1
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   22     0  E >   FETCH_STATIC_PROP_R          unknown             ~1      'var_1'
          1        CONCAT                                           ~2      'Bar%3A+', ~1
          2        CONCAT                                           ~3      ~2, '%0A'
          3        ECHO                                                     ~3
   24     4        ROPE_INIT                                     3  ~5      'Bar%3A+%7Bstatic%3A%3A'
          5        ROPE_ADD                                      1  ~5      ~5, !0
          6        ROPE_END                                      2  ~4      ~5, '%7D'
          7        CONCAT                                           ~7      ~4, '%0A'
          8        ECHO                                                     ~7
   25     9      > RETURN                                                   null

End of function printstaticitem

Function printitem:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/31m0k
function name:  printItem
number of ops:  6
compiled vars:  !0 = $var_2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   27     0  E >   NOP                                                      
          1        FETCH_OBJ_R                                      ~1      !0
          2        FAST_CONCAT                                      ~2      'Bar%3A+', ~1
          3        CONCAT                                           ~3      ~2, '%0A'
          4        ECHO                                                     ~3
   28     5      > RETURN                                                   null

End of function printitem

Function printphp:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/31m0k
function name:  printPHP
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   ECHO                                                     'PHP+is+great.%0A'
   13     1      > RETURN                                                   null

End of function printphp

End of class bar.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
163.83 ms | 1399 KiB | 13 Q