rfc:undefined_property_error_promotion
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
rfc:undefined_property_error_promotion [2022/04/06 19:35] – marandall | rfc:undefined_property_error_promotion [2022/05/06 18:22] (current) – marandall | ||
---|---|---|---|
Line 3: | Line 3: | ||
* Date: 2022-04-04 | * Date: 2022-04-04 | ||
* Author: Mark Randall, marandall@php.net | * Author: Mark Randall, marandall@php.net | ||
- | * Status: | + | * Status: |
===== Introduction ===== | ===== Introduction ===== | ||
Line 49: | Line 49: | ||
<PHP> | <PHP> | ||
- | if (!empty($obj-> | + | if (isset($obj-> |
echo "Hello " . $obj-> | echo "Hello " . $obj-> | ||
} | } | ||
</ | </ | ||
- | There are several options to discuss: | + | To provide |
- | + | ||
- | - Leave undefined properties as they are | + | |
- | - Throw for accessing any undefined property except for stdClass | + | |
- | - Throw for accessing any undefined property. | + | |
- | + | ||
- | Of these, the option with the most consistency is throwing for accessing any undefined property, including | + | |
===== Backward Incompatible Changes ===== | ===== Backward Incompatible Changes ===== | ||
- | Accessing an undefined property will result in an Error exception being thrown. | + | Accessing an undefined property |
Line 73: | Line 67: | ||
A minor change will be included in the next minor version to alter the existing warning message to indicate the warning will become an error in 9.0. | A minor change will be included in the next minor version to alter the existing warning message to indicate the warning will become an error in 9.0. | ||
- | ===== Proposed | + | ===== Voting ===== |
- | TBD | + | |
+ | Voted started on 2022-04-22, ending 2022-05-05 | ||
+ | |||
+ | <doodle title=" | ||
+ | * Yes | ||
+ | * No | ||
+ | </ | ||
+ | |||
+ | Meta vote: | ||
+ | |||
+ | <doodle title=" | ||
+ | * Backwards compatibility breaks | ||
+ | * Would be in favour, but not in 9.0 | ||
+ | * Do not like stdClass behaviour | ||
+ | * Something else | ||
+ | </ | ||
rfc/undefined_property_error_promotion.txt · Last modified: 2022/05/06 18:22 by marandall