rfc:get_class_disallow_null_parameter
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
rfc:get_class_disallow_null_parameter [2016/08/14 11:10] – add link to showoff. danack | rfc:get_class_disallow_null_parameter [2017/05/29 12:32] – danack | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== PHP RFC: get_class() disallow null parameter ====== | ====== PHP RFC: get_class() disallow null parameter ====== | ||
- | * Version: | + | * Version: |
* Date: 2016-08-12 | * Date: 2016-08-12 | ||
* Author: Danack | * Author: Danack | ||
- | * Status: | + | * Status: |
* First Published at: https:// | * First Published at: https:// | ||
Line 33: | Line 33: | ||
===== Proposal ===== | ===== Proposal ===== | ||
- | Disallow null being passed to the function as a valid parameter. | + | Disallow null being passed to the function as a valid parameter. |
+ | |||
+ | < | ||
+ | Warning: get_class() expects parameter 1 to be object, null given in %s on line %d | ||
+ | </ | ||
I.e. the valid ways to call the function will be: | I.e. the valid ways to call the function will be: | ||
Line 57: | Line 61: | ||
<code php> | <code php> | ||
if ($some_value_that_may_be_null === null) { | if ($some_value_that_may_be_null === null) { | ||
- | $x = null; | + | $x = get_class(); |
} | } | ||
else { | else { | ||
Line 67: | Line 71: | ||
7.2 | 7.2 | ||
- | ===== Proposed | + | ===== Voting ===== |
+ | |||
+ | Should the get_class() function be changed to disallow null being passed as a parameter? As it is not a language or syntax change, the vote will pass if 50%+1 vote yes. | ||
- | The voting question will be "Should the get_class() | + | <doodle title=" |
+ | * Yes | ||
+ | * No | ||
+ | </doodle> | ||
+ | Voting ended on the 8th October 2016 9pm UTC | ||
===== null vs default param ===== | ===== null vs default param ===== | ||
Line 102: | Line 112: | ||
===== Implementation ===== | ===== Implementation ===== | ||
After the project is implemented, | After the project is implemented, | ||
- | - the version(s) it was merged | + | - This was merged |
- | - a link to the git commit(s) | + | - https:// |
- | - a link to the PHP manual | + | - https:// |
rfc/get_class_disallow_null_parameter.txt · Last modified: 2018/03/01 23:26 by carusogabriel