Created
May 3, 2012 02:08
-
-
Save jonathaningram/2582556 to your computer and use it in GitHub Desktop.
Changing is_null($x) to null === $x or !is_null($x) to null !== $x in PHP
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
#!/bin/bash | |
# Assume we look in tmp | |
# For is_null | |
find tmp/ -type f -name "*.php" -exec sed -i -r 's#\([^\!]\)is_null\s*(\([^()]*\))#\1\2 === null#g' {} \; | |
# For !is_null | |
find tmp/ -type f -name "*.php" -exec sed -i -r 's#[\!]is_null\s*(\([^()]*\))#\1 !== null#g' {} \; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment