Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | |
rfc:scalar_type_hints_v5 [2017/09/22 13:28] – external edit 127.0.0.1 | rfc:scalar_type_hints_v5 [2018/10/17 11:38] (current) – Fix table align in "bool" column carusogabriel |
---|
The table shows which types are accepted and converted for scalar type declarations. ''NULL'', arrays and resources are never accepted for scalar type declarations, and so are not included in the table. | The table shows which types are accepted and converted for scalar type declarations. ''NULL'', arrays and resources are never accepted for scalar type declarations, and so are not included in the table. |
| |
^ Type declaration ^ int ^ float ^ string ^ bool ^ object ^ | ^ Type declaration ^ int ^ float ^ string ^ bool ^ object ^ |
^ ''int'' ^ yes ^ yes* ^ yes† ^ yes ^ no ^ | ^ ''int'' ^ yes ^ yes* ^ yes† ^ yes ^ no ^ |
^ ''float'' ^ yes ^ yes ^ yes† ^ yes ^ no ^ | ^ ''float'' ^ yes ^ yes ^ yes† ^ yes ^ no ^ |
^ ''string'' ^ yes ^ yes ^ yes ^ yes ^ yes‡ ^ | ^ ''string'' ^ yes ^ yes ^ yes ^ yes ^ yes‡ ^ |
^ ''bool'' ^ yes ^ yes ^ yes ^ yes ^ no ^ | ^ ''bool'' ^ yes ^ yes ^ yes ^ yes ^ no ^ |
| |
<nowiki>*</nowiki>Only non-NaN floats between ''PHP_INT_MIN'' and ''PHP_INT_MAX'' accepted. (New in PHP 7, see the [[rfc:zpp_fail_on_overflow|ZPP Failure on Overflow]] RFC) | <nowiki>*</nowiki>Only non-NaN floats between ''PHP_INT_MIN'' and ''PHP_INT_MAX'' accepted. (New in PHP 7, see the [[rfc:zpp_fail_on_overflow|ZPP Failure on Overflow]] RFC) |