3v4l.org

run code in 300+ PHP versions simultaneously
<?php #[Attribute] enum DemoEnum {} #[Attribute] trait DemoTrait {} #[Attribute] abstract class DemoAbstract {} #[Attribute] interface DemoInterface {} #[DemoEnum] #[DemoTrait] #[DemoAbstract] #[DemoInterface] function usesWrongAttrib() {} $r = new ReflectionFunction( 'usesWrongAttrib' ); $a = $r->getAttributes(); var_dump( $a ); foreach ( $a as $attrib ) { try { $attrib->newInstance(); } catch ( Error $e ) { echo get_class( $e ) . ": " . $e->getMessage() . "\n"; } }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 12, Position 2 = 25
Branch analysis from position: 12
2 jumps found. (Code = 78) Position 1 = 13, Position 2 = 25
Branch analysis from position: 13
1 jumps found. (Code = 42) Position 1 = 24
Branch analysis from position: 24
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
Branch analysis from position: 25
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 25
Found catch point at position: 16
Branch analysis from position: 16
2 jumps found. (Code = 107) Position 1 = 17, Position 2 = -2
Branch analysis from position: 17
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
filename:       /in/99PhY
function name:  (null)
number of ops:  27
compiled vars:  !0 = $r, !1 = $a, !2 = $attrib, !3 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   DECLARE_CLASS                                            'demoenum'
   21     1        NEW                                              $4      'ReflectionFunction'
          2        SEND_VAL_EX                                              'usesWrongAttrib'
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !0, $4
   22     5        INIT_METHOD_CALL                                         !0, 'getAttributes'
          6        DO_FCALL                                      0  $7      
          7        ASSIGN                                                   !1, $7
   23     8        INIT_FCALL                                               'var_dump'
          9        SEND_VAR                                                 !1
         10        DO_ICALL                                                 
   24    11      > FE_RESET_R                                       $10     !1, ->25
         12    > > FE_FETCH_R                                               $10, !2, ->25
   26    13    >   INIT_METHOD_CALL                                         !2, 'newInstance'
         14        DO_FCALL                                      0          
         15      > JMP                                                      ->24
   27    16  E > > CATCH                                       last         'Error'
   28    17    >   GET_CLASS                                        ~12     !3
         18        CONCAT                                           ~13     ~12, '%3A+'
         19        INIT_METHOD_CALL                                         !3, 'getMessage'
         20        DO_FCALL                                      0  $14     
         21        CONCAT                                           ~15     ~13, $14
         22        CONCAT                                           ~16     ~15, '%0A'
         23        ECHO                                                     ~16
   24    24    > > JMP                                                      ->12
         25    >   FE_FREE                                                  $10
   30    26      > RETURN                                                   1

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

End of function useswrongattrib

Class DemoEnum: [no user functions]
Class DemoTrait: [no user functions]
Class DemoAbstract: [no user functions]
Class DemoInterface: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
144.3 ms | 1001 KiB | 14 Q