note 72688 added to function.get-class-vars
| From: | berndattiggersweltdotnet at osu1 dot php dot net | Date: | Mon, 29 Jan 2007 22:52:33 +0000 |
| Subject: | note 72688 added to function.get-class-vars | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-122336@lists.php.net to get a copy of this message | ||
If you assign a constant value using the self-scope by default to a variable, get_class_vars() will
result in a FATAL error.
Example:
<?PHP
class Foo {
const Bar = "error";
public $Foo = self::Bar;
}
print_r(get_class_vars("Foo"));
?>
... but using "Foo::Bar" instead "self::Bar" will work ;)
----
Server IP: 217.160.72.57
Probable Submitter: 85.116.204.39
----
Manual Page -- http://www.php.net/manual/en/function.get-class-vars.php
Edit -- https://master.php.net/note/edit/72688
Del: integrated -- https://master.php.net/note/delete/72688/integrated
Del: useless -- https://master.php.net/note/delete/72688/useless
Del: bad code -- https://master.php.net/note/delete/72688/bad+code
Del: spam -- https://master.php.net/note/delete/72688/spam
Del: non-english -- https://master.php.net/note/delete/72688/non-english
Del: in docs -- https://master.php.net/note/delete/72688/in+docs
Del: other reasons-- https://master.php.net/note/delete/72688
Reject -- https://master.php.net/note/reject/72688
Search -- https://master.php.net/manage/user-notes.php