At 10:07 AM 3/15/2004 -0500, Hans Lellelid wrote:
I notice that in the new RC1, the following reference to class constants is no longer possible:

class MyClass {
        const MY_CONST = 1;
        function __construct() {
                echo MY_CONST;
        }
}

You must now use self::MY_CONST to reference the class constant. While I can see that the pre-RC1 behavior would not provide a way to access global constant if class had const of same name ... I figured I'd ask anyway whether this change is intended or a side-effect of some other fix. I fall into the category of people who were really enjoying not having to specify self:: before (so now I have a lot of code to fix, apparently).

Hey,


I fixed it intentionally. That piece of code was left over from the days of our broken namespaces implementation where we would do two lookups. Methods were fixed a long time ago but we forgot to remove the old code from constants.

Andi

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to