conventions:php_null
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | Next revisionBoth sides next revision | ||
php_null [2021/08/17 16:04] – diogo | php_null [2021/08/18 08:51] – Introduce Diogo's vote diogo | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== The absence of value ====== | ====== The absence of value ====== | ||
+ | |||
< | < | ||
When programming in PHP it's common having to represent the absence of value. | When programming in PHP it's common having to represent the absence of value. | ||
Line 58: | Line 59: | ||
A non-void function, by definition, is expected to return a value. | A non-void function, by definition, is expected to return a value. | ||
If it couldn' | If it couldn' | ||
- | strict comparison. Hence, as you're testing whether a variable is of type null, then you should use `is_null($var)`. | + | strict comparison. Hence, as you're testing whether a variable |
Just as you normally would with an `is_int($var)` | Just as you normally would with an `is_int($var)` | ||
</ | </ | ||
Line 67: | Line 68: | ||
Voter|is_null|=== null | Voter|is_null|=== null | ||
-----|-------|-------- | -----|-------|-------- | ||
+ | Diogo| | ||
</ | </ |
conventions/php_null.txt · Last modified: 2021/12/08 00:28 by diogo