Last active
August 29, 2015 14:16
-
-
Save patrickallaert/d751733fea4545777d4f to your computer and use it in GitHub Desktop.
Why https://wiki.php.net/rfc/array-to-string should not pass
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 | |
function doSomeStuff($myArg) { | |
if (!is_string($myArg)) { | |
// Will break if it passes and $myArg is an array while not being business logic but pure logging | |
trigger_error("Wrong data passed: $myArg", E_USER_NOTICE); | |
} | |
// Rest of the function | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment