3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { const BAR = 'foo_bar'; static $baz = 'foo_baz'; function getBaz() { return static::$baz; } } class Bar extends Foo { } var_dump(Bar::BAR); var_dump(Bar::$baz); var_dump((new Bar())->getBaz());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/tqFSt
function name:  (null)
number of ops:  15
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   INIT_FCALL                                               'var_dump'
          1        SEND_VAL                                                 'foo_bar'
          2        DO_ICALL                                                 
   15     3        INIT_FCALL                                               'var_dump'
          4        FETCH_STATIC_PROP_R          unknown             ~1      'baz'
          5        SEND_VAL                                                 ~1
          6        DO_ICALL                                                 
   16     7        INIT_FCALL                                               'var_dump'
          8        NEW                                              $3      'Bar'
          9        DO_FCALL                                      0          
         10        INIT_METHOD_CALL                                         $3, 'getBaz'
         11        DO_FCALL                                      0  $5      
         12        SEND_VAR                                                 $5
         13        DO_ICALL                                                 
         14      > RETURN                                                   1

Class Foo:
Function getbaz:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/tqFSt
function name:  getBaz
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   FETCH_STATIC_PROP_R          unknown             ~0      'baz'
          1      > RETURN                                                   ~0
    8     2*     > RETURN                                                   null

End of function getbaz

End of class Foo.

Class Bar:
Function getbaz:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/tqFSt
function name:  getBaz
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   FETCH_STATIC_PROP_R          unknown             ~0      'baz'
          1      > RETURN                                                   ~0
    8     2*     > RETURN                                                   null

End of function getbaz

End of class Bar.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.65 ms | 1395 KiB | 15 Q