Annotation of embedaddon/php/Zend/tests/class_constants_003.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: class constants as default function arguments and dynamically loaded classes
! 3: --FILE--
! 4: <?php
! 5:
! 6: $class_data = <<<DATA
! 7: <?php
! 8: class test {
! 9: const val = 1;
! 10: }
! 11: ?>
! 12: DATA;
! 13:
! 14: $filename = dirname(__FILE__)."/cc003.dat";
! 15: file_put_contents($filename, $class_data);
! 16:
! 17: function foo($v = test::val) {
! 18: var_dump($v);
! 19: }
! 20:
! 21: include $filename;
! 22:
! 23: foo();
! 24: foo(5);
! 25:
! 26: unlink($filename);
! 27:
! 28: echo "Done\n";
! 29: ?>
! 30: --EXPECTF--
! 31: int(1)
! 32: int(5)
! 33: Done
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>