|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2018-10-02 17:55 UTC] itay dot moav at email dot sitel dot org
Description:
------------
The following code will return 1
I would expect it to fail
class A{
static public function r():bool{
return 'ww';
}
}
Test script:
---------------
class A{
static public function r():bool{
return 'ww';
}
}
var_dump(A::r());
Expected result:
----------------
I expect this call to fail with proper error message
Actual result:
--------------
casts the return value to 1 (int)
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Dec 15 13:00:01 2025 UTC |
it's one thing taht you dont't understand strict typing but what you repoted is simly not true and WHERE is the execution part of your snippet? [harry@srv-rhsoft:/downloads]$ cat test.php <?php class A{ static public function r():bool{ return 'ww'; } } var_dump(A::r()); ?> [harry@srv-rhsoft:/downloads]$ php test.php bool(true)