Annotation of embedaddon/php/ext/filter/tests/017.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: filter_var() and FILTER_VALIDATE_REGEXP
! 3: --SKIPIF--
! 4: <?php if (!extension_loaded("filter")) die("skip"); ?>
! 5: --FILE--
! 6: <?php
! 7:
! 8: var_dump(filter_var("data", FILTER_VALIDATE_REGEXP, array("options"=>array("regexp"=>'/.*/'))));
! 9: var_dump(filter_var("data", FILTER_VALIDATE_REGEXP, array("options"=>array("regexp"=>'/^b(.*)/'))));
! 10: var_dump(filter_var("data", FILTER_VALIDATE_REGEXP, array("options"=>array("regexp"=>'/^d(.*)/'))));
! 11: var_dump(filter_var("data", FILTER_VALIDATE_REGEXP, array("options"=>array("regexp"=>'/blah/'))));
! 12: var_dump(filter_var("data", FILTER_VALIDATE_REGEXP, array("options"=>array("regexp"=>'/\[/'))));
! 13: var_dump(filter_var("data", FILTER_VALIDATE_REGEXP));
! 14:
! 15: echo "Done\n";
! 16: ?>
! 17: --EXPECTF--
! 18: string(4) "data"
! 19: bool(false)
! 20: string(4) "data"
! 21: bool(false)
! 22: bool(false)
! 23:
! 24: Warning: filter_var(): 'regexp' option missing in %s on line %d
! 25: bool(false)
! 26: Done
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>