3v4l.org

run code in 300+ PHP versions simultaneously
<?php interface I {} function foo() { return new class { public static function foo() { return new class implements I {}; } }; } var_dump(get_class(foo()::foo()));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/XLgQG
function name:  (null)
number of ops:  10
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   INIT_FCALL                                               'var_dump'
          1        INIT_FCALL                                               'foo'
          2        DO_FCALL                                      0  $0      
          3        FETCH_CLASS                                   0  $1      $0
          4        INIT_STATIC_METHOD_CALL                                  $1, 'foo'
          5        DO_FCALL                                      0  $2      
          6        GET_CLASS                                        ~3      $2
          7        SEND_VAL                                                 ~3
          8        DO_ICALL                                                 
          9      > RETURN                                                   1

Function foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/XLgQG
function name:  foo
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   DECLARE_ANON_CLASS                               9.88131e-324    
          1        NEW                                              $1      $0
          2        DO_FCALL                                      0          
          3      > RETURN                                                   $1
   10     4*     > RETURN                                                   null

End of function foo

Class I: [no user functions]
Class I@anonymous: [no user functions]
Class class@anonymous:
Function foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/XLgQG
function name:  foo
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   DECLARE_ANON_CLASS                               <array> 
          1        NEW                                              $1      $0
          2        DO_FCALL                                      0          
          3      > RETURN                                                   $1
    8     4*     > RETURN                                                   null

End of function foo

End of class class@anonymous.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
175.78 ms | 1398 KiB | 16 Q