Created
January 25, 2016 20:30
-
-
Save blar/4d4fe59e2453ae845f7d to your computer and use it in GitHub Desktop.
realpath mit strict_types
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); | |
$path = 'foobar'; | |
var_dump($path); | |
$path = realpath($path); | |
var_dump($path); | |
$path = realpath($path); | |
var_dump($path); | |
string(6) "foobar" | |
bool(false) | |
Fatal error: Uncaught TypeError: realpath() expects parameter 1 to be a valid path, boolean given in -:11 | |
Stack trace: | |
#0 -(11): realpath(false) | |
#1 {main} | |
thrown in - on line 11 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment