Zeev
At 21:14 23/08/2003, Brad Bulger wrote:
hmm. but you can reference class constants without class/self:: when creating futher constants ('const bla = foo << 1;') and this works, too:
<?php class foo { const bar = 3; function bla($x) { if ($x === bar) print "yes it's bar\n"; else print "no it's not\n"; } } $x = new foo; $x->bla(4); $x->bla(3); ?> >> Output: >> no it's not >> yes it's bar
Zeev Suraski wrote:
At 14:35 22/08/2003, Arjen Brouwer wrote:
Should'nt this work? Currently it reports an error about a undefined constant.
<? class Test { const FOO = 100; var $bar = FOO;
Should be var $bar = Test::FOO (or self::FOO, even though it appears not to work right now) - there's no implicit class/object dereference of any kind in PHP.
Zeev
-- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php
-- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php