3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Event {} $event = (new class() extends Event { public function getName() { return 'anonyme !'; } }); var_dump(get_class($event)); $event = (new class() { public function getName() { return 'anonyme !'; } }); var_dump(get_class($event));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/RGc7E
function name:  (null)
number of ops:  17
compiled vars:  !0 = $event
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   DECLARE_ANON_CLASS                               <unknown> 'event'
          1        NEW                                              $2      $1
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $2
    8     4        INIT_FCALL                                               'var_dump'
          5        GET_CLASS                                        ~5      !0
          6        SEND_VAL                                                 ~5
          7        DO_ICALL                                                 
   10     8        DECLARE_ANON_CLASS                               <undef> 
          9        NEW                                              $8      $7
         10        DO_FCALL                                      0          
         11        ASSIGN                                                   !0, $8
   13    12        INIT_FCALL                                               'var_dump'
         13        GET_CLASS                                        ~11     !0
         14        SEND_VAL                                                 ~11
         15        DO_ICALL                                                 
         16      > RETURN                                                   1

Class Event: [no user functions]
Class Event@anonymous:
Function getname:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/RGc7E
function name:  getName
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E > > RETURN                                                   'anonyme+%21'
          1*     > RETURN                                                   null

End of function getname

End of class Event@anonymous.

Class class@anonymous:
Function getname:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/RGc7E
function name:  getName
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E > > RETURN                                                   'anonyme+%21'
          1*     > RETURN                                                   null

End of function getname

End of class class@anonymous.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.58 ms | 1395 KiB | 15 Q