3v4l.org

run code in 300+ PHP versions simultaneously
<?php class test { static protected $var = 'asdf'; public function getStatic ($name) { return static::${$name}; } /// TODO think how to get rid of these funcs }; $a = new test(); print $a->getStatic('var');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/BEa22
function name:  (null)
number of ops:  8
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   NEW                                              $1      'test'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   10     3        INIT_METHOD_CALL                                         !0, 'getStatic'
          4        SEND_VAL_EX                                              'var'
          5        DO_FCALL                                      0  $4      
          6        ECHO                                                     $4
          7      > RETURN                                                   1

Class test:
Function getstatic:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/BEa22
function name:  getStatic
number of ops:  4
compiled vars:  !0 = $name
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
          1        FETCH_STATIC_PROP_R          unknown             ~1      !0
          2      > RETURN                                                   ~1
          3*     > RETURN                                                   null

End of function getstatic

End of class test.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.32 ms | 1384 KiB | 13 Q