|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2015-11-02 10:03 UTC] php at developerjack dot com
[2015-11-26 19:41 UTC] webmaster at tubo-world dot de
[2015-11-26 19:58 UTC] nikic@php.net
-Status: Open
+Status: Not a bug
[2015-11-26 19:58 UTC] nikic@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2026 The PHP GroupAll rights reserved. |
Last updated: Tue Oct 06 17:00:01 2026 UTC |
Description: ------------ You can cast to boolean using either (bool)$var or (boolean)$var. In scalar type hints currently only bool could be used which is inconsistent. Test script: --------------- <?php $boolean = 1; $boolean = (boolean) $boolean; function dump_boolean(boolean $var) { var_dump($var); } dump_boolean($boolean); // https://3v4l.org/Cdtoe Expected result: ---------------- I'd expect both boolean and bool work as scalar type hint because both work well for type casting. Actual result: -------------- https://3v4l.org/egb59