3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Something { public function something() { return self::class; } } $class = new Something; $class2 = new ${$class->something()};
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/FXiSP
function name:  (null)
number of ops:  11
compiled vars:  !0 = $class, !1 = $class2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   NEW                                              $2      'Something'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   10     3        INIT_METHOD_CALL                                         !0, 'something'
          4        DO_FCALL                                      0  $5      
          5        FETCH_R                      local               ~6      $5
          6        FETCH_CLASS                                   0  $7      ~6
          7        NEW                                              $8      $7
          8        DO_FCALL                                      0          
          9        ASSIGN                                                   !1, $8
         10      > RETURN                                                   1

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

End of function something

End of class Something.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.51 ms | 1384 KiB | 13 Q