3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A {} class B { const WAT = ['lol' => A::class]; public static function test() { $lol = 'lol'; return new (self::WAT[$lol])(); } } B::test();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/uoE6s
function name:  (null)
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   INIT_STATIC_METHOD_CALL                                  'B', 'test'
          1        DO_FCALL                                      0          
          2      > RETURN                                                   1

Class A: [no user functions]
Class B:
Function test:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/uoE6s
function name:  test
number of ops:  7
compiled vars:  !0 = $lol
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   ASSIGN                                                   !0, 'lol'
   10     1        FETCH_DIM_R                                      ~2      <array>, !0
          2        FETCH_CLASS                                   0  $3      ~2
          3        NEW                                              $4      $3
          4        DO_FCALL                                      0          
          5      > RETURN                                                   $4
   11     6*     > RETURN                                                   null

End of function test

End of class B.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.95 ms | 1011 KiB | 13 Q