note 96530 added to language.oop5.constants
| From: | frivera at atom dot com dot gt | Date: | Wed, 03 Mar 2010 18:13:33 +0000 |
| Subject: | note 96530 added to language.oop5.constants | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-166590@lists.php.net to get a copy of this message | ||
<?php
class Foo {
const A = 'xx';
}
$match = 'A';
var_dump( Foo::$match );
?>
Fatal error: Access to undeclared static property: Foo::$match
How do you get the constant here?
###############
don't use the dollar character
var_dump( Foo::match );
I'm not sure but I think this is not the place to ask questions, but in the mean time
that's the answer
----
Server IP: 69.147.83.197
Probable Submitter: 190.148.146.127
----
Manual Page -- http://www.php.net/manual/en/language.oop5.constants.php
Edit -- https://master.php.net/note/edit/96530
Del: integrated -- https://master.php.net/note/delete/96530/integrated
Del: useless -- https://master.php.net/note/delete/96530/useless
Del: bad code -- https://master.php.net/note/delete/96530/bad+code
Del: spam -- https://master.php.net/note/delete/96530/spam
Del: non-english -- https://master.php.net/note/delete/96530/non-english
Del: in docs -- https://master.php.net/note/delete/96530/in+docs
Del: other reasons-- https://master.php.net/note/delete/96530
Reject -- https://master.php.net/note/reject/96530
Search -- https://master.php.net/manage/user-notes.php