Annotation of embedaddon/php/ext/filter/tests/038.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: Test scalar, array
! 3: --SKIPIF--
! 4: <?php if (!extension_loaded("filter")) die("skip"); ?>
! 5: --FILE--
! 6: <?php
! 7:
! 8: $var = 12;
! 9: $res = filter_var($var, FILTER_VALIDATE_INT, array('flags'=>FILTER_FLAG_ALLOW_OCTAL));
! 10: var_dump($res);
! 11:
! 12: $var = array(12);
! 13: $res = filter_var($var, FILTER_VALIDATE_INT, array('flags'=>FILTER_FLAG_ALLOW_OCTAL));
! 14: var_dump($res);
! 15:
! 16: $var = 12;
! 17: $res = filter_var($var, FILTER_VALIDATE_INT, array('flags'=>FILTER_FLAG_ALLOW_OCTAL|FILTER_FORCE_ARRAY));
! 18: var_dump($res);
! 19:
! 20:
! 21:
! 22: $var = 12;
! 23: $res = filter_var($var, FILTER_VALIDATE_INT, array('flags'=>FILTER_FLAG_ALLOW_OCTAL|FILTER_REQUIRE_ARRAY));
! 24: var_dump($res);
! 25:
! 26: $var = array(12);
! 27: $res = filter_var($var, FILTER_VALIDATE_INT, array('flags'=>FILTER_FLAG_ALLOW_OCTAL|FILTER_REQUIRE_ARRAY));
! 28: var_dump($res);
! 29:
! 30: $var = array(12);
! 31: $res = filter_var($var, FILTER_VALIDATE_INT, array('flags'=>FILTER_FLAG_ALLOW_OCTAL|FILTER_FORCE_ARRAY|FILTER_REQUIRE_ARRAY));
! 32: var_dump($res);
! 33:
! 34: $var = array(12);
! 35: $res = filter_var($var, FILTER_VALIDATE_INT, array('flags'=>FILTER_FLAG_ALLOW_OCTAL|FILTER_FORCE_ARRAY));
! 36: var_dump($res);
! 37:
! 38: ?>
! 39: --EXPECT--
! 40: int(12)
! 41: bool(false)
! 42: array(1) {
! 43: [0]=>
! 44: int(12)
! 45: }
! 46: bool(false)
! 47: array(1) {
! 48: [0]=>
! 49: int(12)
! 50: }
! 51: array(1) {
! 52: [0]=>
! 53: int(12)
! 54: }
! 55: array(1) {
! 56: [0]=>
! 57: int(12)
! 58: }
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>