Annotation of embedaddon/php/Zend/tests/008.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: define() tests
! 3: --FILE--
! 4: <?php
! 5:
! 6: var_dump(define());
! 7: var_dump(define("TRUE"));
! 8: var_dump(define("TRUE", 1));
! 9: var_dump(define("TRUE", 1, array(1)));
! 10:
! 11: var_dump(define(array(1,2,3,4,5), 1));
! 12: var_dump(define(" ", 1));
! 13: var_dump(define("[[[", 2));
! 14: var_dump(define("test const", 3));
! 15: var_dump(define("test const", 3));
! 16: var_dump(define("test", array(1)));
! 17: var_dump(define("test1", new stdclass));
! 18:
! 19: var_dump(constant(" "));
! 20: var_dump(constant("[[["));
! 21: var_dump(constant("test const"));
! 22:
! 23: echo "Done\n";
! 24: ?>
! 25: --EXPECTF--
! 26: Warning: define() expects at least 2 parameters, 0 given in %s on line %d
! 27: NULL
! 28:
! 29: Warning: define() expects at least 2 parameters, 1 given in %s on line %d
! 30: NULL
! 31: bool(true)
! 32:
! 33: Warning: define() expects parameter 3 to be boolean, array given in %s on line %d
! 34: NULL
! 35:
! 36: Warning: define() expects parameter 1 to be string, array given in %s on line %d
! 37: NULL
! 38: bool(true)
! 39: bool(true)
! 40: bool(true)
! 41:
! 42: Notice: Constant test const already defined in %s on line %d
! 43: bool(false)
! 44:
! 45: Warning: Constants may only evaluate to scalar values in %s on line %d
! 46: bool(false)
! 47:
! 48: Warning: Constants may only evaluate to scalar values in %s on line %d
! 49: bool(false)
! 50: int(1)
! 51: int(2)
! 52: int(3)
! 53: Done
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>