Created
May 9, 2019 21:00
-
-
Save tomasnorre/fa068f8b10895311b788f239e0ee9f84 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ php test.php | |
PHP Fatal error: Uncaught TypeError: Return value of doStuff() must be of the type bool, int returned in test.php:10 | |
Stack trace: | |
#0 test.php(13): doStuff() | |
#1 {main} | |
thrown in test.php on line 10 | |
Fatal error: Uncaught TypeError: Return value of doStuff() must be of the type bool, int returned in test.php:10 | |
Stack trace: | |
#0 test.php(13): doStuff() | |
#1 {main} | |
thrown in test.php on line 10 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
declare(strict_types=1); | |
function gimmeTrue(): bool { return true; } | |
function doStuff(): bool | |
{ | |
$success = gimmeTrue(); | |
$success &= gimmeTrue(); | |
return $success; | |
} | |
doStuff(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment