Created
August 16, 2013 12:57
-
-
Save LinuxDoku/6249742 to your computer and use it in GitHub Desktop.
markup filter regex for variable assignment inside if()
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[ \n]*\([0]*[^ ]*\$[a-z0-9-_]+[ ]*=[^=]+[ ]*[^ ]+[ ]*\) |
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 | |
if($a = 'test') // true | |
if($a='Test') // true | |
if($a="Test") // true | |
if($a = "Test") // true | |
if ($a = 'Test' ) // true | |
if | |
($a = "Hallo Welt") // true | |
if($a == 'test') | |
if(test::$a = "Hallo Welt") // true | |
if(($a = "Test")) // true | |
if($a = (2 + 1)) // FAIL | |
if($a = ($a = 2 + 1)) // FAIL | |
if($a == "test" && ($a = 2)) // FAIL | |
// to detect mistakes ;-) | |
if(test::$a === 'Test') | |
if($a === "Hallo Welt") | |
if($a) | |
$a = "Test" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment