conventions:php_null
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionLast revisionBoth sides next revision | ||
php_null [2021/08/17 16:04] – diogo | php_null [2021/08/18 18:35] – Add Eliseu'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 65: | Line 66: | ||
< | < | ||
- | Voter|is_null|=== null | + | Voter | `is_null()` | `=== null` |
- | -----|-------|-------- | + | ---------|-------------|--------- |
+ | XRevan86 |X |- | ||
+ | Diogo |X |- | ||
+ | Hugo | ||
+ | Eliseu | ||
</ | </ |
conventions/php_null.txt · Last modified: 2021/12/08 00:28 by diogo