/2.0/Tests/@PHP/standard/strings/add-and-stripslashes.php
PHP | 26 lines | 22 code | 4 blank | 0 comment | 5 complexity | 9efcb9e13891d0f3bdccafb855721342 MD5 | raw file
Possible License(s): CPL-1.0, GPL-2.0, CC-BY-SA-3.0, MPL-2.0-no-copyleft-exception, Apache-2.0
- [expect php]
- [file]
- <?php
-
- $input = '';
- for($i=0; $i<512; $i++) {
- $input .= chr($i%256);
- }
-
- echo "Normal: ";
- ini_set('magic_quotes_sybase', 0);
- if($input === stripslashes(addslashes($input))) {
- echo "OK\n";
- } else {
- echo "FAILED\n";
- }
-
- echo "Sybase: ";
- ini_set('magic_quotes_sybase', 1);
- if($input === stripslashes(addslashes($input))) {
- echo "OK\n";
- } else {
- echo "FAILED\n";
- }
-
- ?>