php5: read-only variables

From: Date: Mon, 09 Feb 2004 07:26:50 +0000
Subject: php5: read-only variables
Groups: php.general php.qa 
Request: Send a blank email to php-general+get-177185@lists.php.net to get a copy of this message
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: <?php $doc = new DomDocument(); $root = new DomElement("root"); $root->tagName = "test"; // this, of course, doesn't work... print($root->tagName); $root = $doc->appendChild($root); ?> The output is a fatal error: Fatal error: main() [function.main]: Cannot write property in ... on line 5 But i don't think they'll make any changes on it at this (beta) state? If anybody has an acceptable fake-solution, please let me know... thanks vivi

« previous php.general (#177185) next »