Annotation of embedaddon/php/Zend/tests/018.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: constant() tests
! 3: --FILE--
! 4: <?php
! 5:
! 6: var_dump(constant());
! 7: var_dump(constant("", ""));
! 8: var_dump(constant(""));
! 9:
! 10: var_dump(constant(array()));
! 11:
! 12: define("TEST_CONST", 1);
! 13: var_dump(constant("TEST_CONST"));
! 14:
! 15: define("TEST_CONST2", "test");
! 16: var_dump(constant("TEST_CONST2"));
! 17:
! 18: echo "Done\n";
! 19: ?>
! 20: --EXPECTF--
! 21: Warning: constant() expects exactly 1 parameter, 0 given in %s on line %d
! 22: NULL
! 23:
! 24: Warning: constant() expects exactly 1 parameter, 2 given in %s on line %d
! 25: NULL
! 26:
! 27: Warning: constant(): Couldn't find constant in %s on line %d
! 28: NULL
! 29:
! 30: Warning: constant() expects parameter 1 to be string, array given in %s on line %d
! 31: NULL
! 32: int(1)
! 33: string(4) "test"
! 34: Done
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>