3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { protected static $bar = 'bar'; function test() { echo 'Non-static access: ', var_export($this->bar, true), PHP_EOL; echo 'Static access: ', var_export(self::$bar, true), PHP_EOL; } } (new Foo)->test();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/93HQL
function name:  (null)
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   NEW                                              $0      'Foo'
          1        DO_FCALL                                      0          
          2        INIT_METHOD_CALL                                         $0, 'test'
          3        DO_FCALL                                      0          
          4      > RETURN                                                   1

Class Foo:
Function test:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/93HQL
function name:  test
number of ops:  17
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   ECHO                                                     'Non-static+access%3A+'
          1        INIT_FCALL                                               'var_export'
          2        FETCH_OBJ_R                                      ~0      'bar'
          3        SEND_VAL                                                 ~0
          4        SEND_VAL                                                 <true>
          5        DO_ICALL                                         $1      
          6        ECHO                                                     $1
          7        ECHO                                                     '%0A'
    8     8        ECHO                                                     'Static+access%3A+'
          9        INIT_FCALL                                               'var_export'
         10        FETCH_STATIC_PROP_R          unknown             ~2      'bar'
         11        SEND_VAL                                                 ~2
         12        SEND_VAL                                                 <true>
         13        DO_ICALL                                         $3      
         14        ECHO                                                     $3
         15        ECHO                                                     '%0A'
    9    16      > RETURN                                                   null

End of function test

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
182.5 ms | 1445 KiB | 14 Q