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/21 21:30] – 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 were 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, including for stdClass. | + | Accessing an undefined property |
Line 75: | Line 69: | ||
===== Voting ===== | ===== Voting ===== | ||
- | <doodle title=" | + | Voted started on 2022-04-22, ending 2022-05-05 |
+ | |||
+ | <doodle title=" | ||
* Yes | * Yes | ||
* No | * 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.1650576605.txt.gz · Last modified: 2022/04/21 21:30 by marandall