3v4l.org

run code in 500+ PHP versions simultaneously
<?php #[Attribute] class x {} class y extends x {} $ref = new \ReflectionFunction(#[x, y] function () { }); try { $ref->getAttributes()[0]->newInstance(); $ref->getAttributes()[1]->newInstance(); } catch (\Error $e) { var_dump('Error : ', $e->getMessage()); } ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 23
Branch analysis from position: 23
1 jumps found. (Code = 62) Position 1 = -2
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 = 62) Position 1 = -2
filename:       /in/tDOsd
function name:  (null)
number of ops:  24
compiled vars:  !0 = $ref, !1 = $e
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    8     0  E >   NEW                                                  $2      'ReflectionFunction'
          1        DECLARE_LAMBDA_FUNCTION                              ~3      [0]
          2        SEND_VAL_EX                                                  ~3
          3        DO_FCALL                                          0          
          4        ASSIGN                                                       !0, $2
   11     5        INIT_METHOD_CALL                                             !0, 'getAttributes'
          6        DO_FCALL                                          0  $6      
          7        FETCH_DIM_R                                          ~7      $6, 0
          8        INIT_METHOD_CALL                                             ~7, 'newInstance'
          9        DO_FCALL                                          0          
   12    10        INIT_METHOD_CALL                                             !0, 'getAttributes'
         11        DO_FCALL                                          0  $9      
         12        FETCH_DIM_R                                          ~10     $9, 1
         13        INIT_METHOD_CALL                                             ~10, 'newInstance'
         14        DO_FCALL                                          0          
         15      > JMP                                                          ->23
   13    16  E > > CATCH                                           last         'Error'
   14    17    >   INIT_FCALL                                                   'var_dump'
         18        SEND_VAL                                                     'Error+%3A+'
         19        INIT_METHOD_CALL                                             !1, 'getMessage'
         20        DO_FCALL                                          0  $12     
         21        SEND_VAR                                                     $12
         22        DO_ICALL                                                     
   17    23    > > RETURN                                                       1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/tDOsd
function name:  {closure:/in/tDOsd:8}
number of ops:  1
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    8     0  E > > RETURN                                                       null

End of Dynamic Function 0

Class x: [no user functions]
Class y: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
171.76 ms | 3382 KiB | 14 Q