PageRenderTime 41ms CodeModel.GetById 16ms RepoModel.GetById 1ms app.codeStats 0ms

/hphp/test/zend/bad/ext/standard/tests/strings/stristr_basic.php

http://github.com/facebook/hiphop-php
PHP | 20 lines | 14 code | 3 blank | 3 comment | 0 complexity | 52d015f05b8061b0d33cc9708386fa4d MD5 | raw file
Possible License(s): LGPL-2.1, BSD-2-Clause, BSD-3-Clause, MPL-2.0-no-copyleft-exception, MIT, LGPL-2.0, Apache-2.0
  1. <?php
  2. /* Prototype: string stristr ( string $haystack , mixed $needle [, bool $before_needle ] )
  3. Description: Case-insensitive strstr().
  4. */
  5. echo "*** Testing stristr() : basic functionality ***\n";
  6. var_dump( stristr("Test string", "teSt") );
  7. var_dump( stristr("test stRIng", "striNG") );
  8. var_dump( stristr("teST StrinG", "stRIn") );
  9. var_dump( stristr("tesT string", "t S") );
  10. var_dump( stristr("test strinG", "g") );
  11. var_dump( bin2hex(stristr(b"te".chr(0).b"St", chr(0))) );
  12. var_dump( stristr("tEst", "test") );
  13. var_dump( stristr("teSt", "test") );
  14. var_dump( stristr("Test String", "String", false) );
  15. var_dump( stristr("Test String", "String", true) );
  16. ?>
  17. ===DONE===