/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
- [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";
- }
-
- ?>