Annotation of embedaddon/php/ext/filter/tests/036.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: input_get_args() and references
! 3: --SKIPIF--
! 4: <?php if (!extension_loaded("filter")) print "skip"; ?>
! 5: --FILE--
! 6: <?php
! 7:
! 8: $var = "1";
! 9:
! 10: $data = array();
! 11: $data["test1"] = 1;
! 12: $data["test2"] = &$var;
! 13:
! 14: $args = array();
! 15: $args["test1"] = FILTER_VALIDATE_INT;
! 16: $args["test2"] = FILTER_VALIDATE_INT;
! 17:
! 18: $ret = filter_var_array($data, $args);
! 19: var_dump($ret);
! 20: var_dump($data); //should be separated, i.e. not reference anymore. looks like we can't change this, or it'd change the original zval instead..
! 21: var_dump($var); //should be still string(1) "1"
! 22:
! 23: echo "Done\n";
! 24: ?>
! 25: --EXPECTF--
! 26: array(2) {
! 27: ["test1"]=>
! 28: int(1)
! 29: ["test2"]=>
! 30: int(1)
! 31: }
! 32: array(2) {
! 33: ["test1"]=>
! 34: int(1)
! 35: ["test2"]=>
! 36: &string(1) "1"
! 37: }
! 38: string(1) "1"
! 39: Done
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>