preg_match_variation1.phpt 533 B

12345678910111213141516171819202122
  1. --TEST--
  2. Test preg_match() function : variation
  3. --FILE--
  4. <?php
  5. /*
  6. * proto int preg_match(string pattern, string subject [, array subpatterns [, int flags [, int offset]]])
  7. * Function is implemented in ext/pcre/php_pcre.c
  8. */
  9. //test passing in the same variable where 1 is by value, the other is a different
  10. //type and by reference so should be updated to the new type.
  11. $string = "-1";
  12. preg_match('/[\-\+]?[0-9\.]*/', $string, $string);
  13. var_dump($string);
  14. ?>
  15. ===Done===
  16. --EXPECT--
  17. array(1) {
  18. [0]=>
  19. string(2) "-1"
  20. }
  21. ===Done===