Created
April 4, 2011 19:09
-
-
Save kanonji/902212 to your computer and use it in GitHub Desktop.
test for file_exists() is binary safe or not.
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
If you see that this file is exist, file_exists() is not binary safe. |
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 | |
define( 'DIR', dirname(__FILE__).DIRECTORY_SEPARATOR ); | |
$file = "file_exists-is-not-binary-safe.txt\0"; | |
var_dump( file_exists( DIR.$file.'.php' )); //if true, file_exists() is not binary safe. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment