3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Car{ public static function a(){ return 'hi'; } } class Constants{ public static $use='Car'; } $trim = 'trim'; echo ${"${Constants::$use}"}::a();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/1maPa
function name:  (null)
number of ops:  10
compiled vars:  !0 = $trim
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   ASSIGN                                                   !0, 'trim'
   12     1        FETCH_STATIC_PROP_R          unknown             ~2      'use'
          2        FETCH_R                      local               ~3      ~2
          3        CAST                                          6  ~4      ~3
          4        FETCH_R                      local               ~5      ~4
          5        FETCH_CLASS                                   0  $6      ~5
          6        INIT_STATIC_METHOD_CALL                                  $6, 'a'
          7        DO_FCALL                                      0  $7      
          8        ECHO                                                     $7
          9      > RETURN                                                   1

Class Car:
Function a:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/1maPa
function name:  a
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E > > RETURN                                                   'hi'
    5     1*     > RETURN                                                   null

End of function a

End of class Car.

Class Constants: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.41 ms | 1393 KiB | 13 Q