PageRenderTime 37ms CodeModel.GetById 14ms RepoModel.GetById 1ms app.codeStats 0ms

/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
  1. [expect php]
  2. [file]
  3. <?php
  4. $input = '';
  5. for($i=0; $i<512; $i++) {
  6. $input .= chr($i%256);
  7. }
  8. echo "Normal: ";
  9. ini_set('magic_quotes_sybase', 0);
  10. if($input === stripslashes(addslashes($input))) {
  11. echo "OK\n";
  12. } else {
  13. echo "FAILED\n";
  14. }
  15. echo "Sybase: ";
  16. ini_set('magic_quotes_sybase', 1);
  17. if($input === stripslashes(addslashes($input))) {
  18. echo "OK\n";
  19. } else {
  20. echo "FAILED\n";
  21. }
  22. ?>