Last active
January 10, 2017 16:30
-
-
Save mglinski/b5ddab6e162d0f96c6d28a78af4f715b to your computer and use it in GitHub Desktop.
This file contains 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 | |
function returnsInt() : int { | |
return 2; | |
} | |
function returnsFloat() : float { | |
return 1; | |
} | |
function returnsBool() : bool { | |
return 1; | |
} | |
function returnsString() : string { | |
return 1; | |
} |
This file contains 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 returnsInt() : int { | |
return 2; | |
} | |
function returnsFloat() : float { | |
return 1; | |
} | |
function returnsBool() : bool { | |
return 1; | |
} | |
function returnsString() : string { | |
return 1; | |
} |
This file contains 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 | |
if (rand(0,1)) { | |
echo "Return Types With Strict Types DISABLED in include file\n"; | |
include 'include.php'; | |
} else { | |
echo "Return Types With Strict Types ENABLED in include file\n"; | |
include 'includeStrict.php'; | |
} | |
var_dump([ | |
'returnsInt' => returnsInt(), | |
'returnsFloat' => returnsFloat(), | |
'returnsBool' => returnsBool(), | |
'returnsString' => returnsString(), | |
]); |
This file contains 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); | |
if (rand(0,1)) { | |
echo "Return Types With Strict Types DISABLED in include file\n"; | |
include 'include.php'; | |
} else { | |
echo "Return Types With Strict Types ENABLED in include file\n"; | |
include 'includeStrict.php'; | |
} | |
var_dump([ | |
'returnsInt' => returnsInt(), | |
'returnsFloat' => returnsFloat(), | |
'returnsBool' => returnsBool(), | |
'returnsString' => returnsString(), | |
]); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment