Annotation of embedaddon/php/Zend/tests/selfParent_001.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: Test when constants are initialised. See also selfParent_002.phpt.
! 3: --FILE--
! 4: <?php
! 5: class A {
! 6: const myConst = "const in A";
! 7: const myDynConst = self::myConst;
! 8:
! 9: public static function test() {
! 10: var_dump(self::myDynConst);
! 11: }
! 12: }
! 13:
! 14: class B extends A {
! 15: const myConst = "const in B";
! 16:
! 17: public static function test() {
! 18: var_dump(parent::myDynConst);
! 19: }
! 20: }
! 21:
! 22: A::test();
! 23: B::test();
! 24: ?>
! 25: --EXPECT--
! 26: string(10) "const in A"
! 27: string(10) "const in A"
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>