|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2015-10-09 18:54 UTC] stas@php.net
-Package: PHP Language Specification
+Package: Scripting Engine problem
[2015-10-09 19:32 UTC] nikic@php.net
-Status: Open
+Status: Wont fix
[2015-10-09 19:32 UTC] nikic@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2026 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 07 17:00:02 2026 UTC |
Description: ------------ With the new scalar type hints we cannot type hint with 'integer' or 'bool', it seems that this was deliberately removed, as the wiki says "aliases are removed (integer and boolean)". No reasons for the removal are given, so I hope it's not a big deal if I request that they are added again. It mostly comes down to coding style, I've never used the abbreviated hand versions as why would I write 'bool' and yet 'string' or 'array'? The style doesn't match. Also it doesn't help that the error message is nonsensical (see the script). Test script: --------------- <?php // Uncaught TypeError: Argument 1 passed to {closure}() must be an instance of integer, integer given... (function(integer $value) { var_dump($value); })('1');