3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { static $baz = 'foo_baz'; function getBaz() { return static::$baz; } } class Bar extends Foo { } 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/cBk8I
function name:  (null)
number of ops:  12
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   INIT_FCALL                                               'var_dump'
          1        FETCH_STATIC_PROP_R          global lock         ~0      'baz'
          2        SEND_VAL                                                 ~0
          3        DO_ICALL                                                 
   14     4        INIT_FCALL                                               'var_dump'
          5        NEW                                              $2      'Bar'
          6        DO_FCALL                                      0          
          7        INIT_METHOD_CALL                                         $2, 'getBaz'
          8        DO_FCALL                                      0  $4      
          9        SEND_VAR                                                 $4
         10        DO_ICALL                                                 
         11      > RETURN                                                   1

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

End of function getbaz

End of class Bar.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.19 ms | 1395 KiB | 15 Q