Re: php5: read-only variables

From: Date: Mon, 09 Feb 2004 09:20:54 +0000
Subject: Re: php5: read-only variables
References: 1  Groups: php.general php.qa 
Request: Send a blank email to php-general+get-177189@lists.php.net to get a copy of this message
Hi, On 9 Feb 2004, at 8:26, Vivian Steller wrote:
hello, talking about php5, i'm missing "read-only" attributes/variables for classes/objects. i.e. this would be very useful for implementing the new DOM Level 3 Interfaces as given in http://www.w3.org/TR/2003 CR-DOM-Level-3-Core-20031107/idl-definitions.html . And I don't think of any reason for Zend-Developers not to implement a little keyword "readonly"... particularly they're using it in there C-Code as you can see by testing the following script:
Please see http://cvs.php.net/co.php/ZendEngine2/ZEND_CHANGES Especially [...] * Constants. The Zend Engine 2.0 introduces per-class constants. Example: <?php class Foo { const constant = 'constant'; } echo 'Foo::constant = ' . Foo::constant . "\n"; ?> Old code that has no user-defined classes or functions named 'const' will run without modifications. [...] Jan --

« previous php.general (#177189) next »