Created
July 24, 2012 17:48
-
-
Save niklasvh/3171462 to your computer and use it in GitHub Desktop.
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
<?php | |
echo "*** Testing token_get_all() : 'source' string with different constants ***\n"; | |
$a = 1; | |
$b = 0; | |
$source = array ( | |
// int const | |
'<?php $a = 1 + 034; $b = $a + 0x3F; ?>', | |
// float const | |
'<?php $a = 0.23E-2 + 0.43e2 + 0.5; ?>', | |
// string const | |
'<?php $a = "hello ".\'world\'; ?>', | |
// bool const | |
"<?php \$a = (\$b)? true : false; ?>", | |
"<?php \$b = (\$a)? FALSE : TRUE; ?>", | |
// null const | |
'<?php $b = null | NULL; ?>' | |
); | |
for($count = 0; $count < count($source); $count++) { | |
echo "-- Iteration ".($count + 1)." --\n"; | |
var_dump( token_get_all($source[$count])); | |
} | |
echo "Done" | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment