note 100564 added to language.namespaces.faq
| From: | Anonymous at osu1 dot php dot net | Date: | Sat, 23 Oct 2010 16:07:01 +0000 |
| Subject: | note 100564 added to language.namespaces.faq | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-173399@lists.php.net to get a copy of this message | ||
There is an error in the Example #9 Dangers of using namespaced names inside a double-quoted string:
$a = new "dangerous\name"; // \n is a newline inside double quoted strings!
$obj = new $a;
$a = new 'not\at\all\dangerous'; // no problems here.
$obj = new $a;
the 'new' is not allowed just before a string, this throws a fatal error, the correct code
is:
$a = "dangerous\name"; // \n is a newline inside double quoted strings!
$obj = new $a;
$a = 'not\at\all\dangerous'; // no problems here.
$obj = new $a;
----
Server IP: 69.147.83.197
Probable Submitter: 85.59.197.141
----
Manual Page -- http://www.php.net/manual/en/language.namespaces.faq.php
Edit -- https://master.php.net/note/edit/100564
Del: integrated -- https://master.php.net/note/delete/100564/integrated
Del: useless -- https://master.php.net/note/delete/100564/useless
Del: bad code -- https://master.php.net/note/delete/100564/bad+code
Del: spam -- https://master.php.net/note/delete/100564/spam
Del: non-english -- https://master.php.net/note/delete/100564/non-english
Del: in docs -- https://master.php.net/note/delete/100564/in+docs
Del: other reasons-- https://master.php.net/note/delete/100564
Reject -- https://master.php.net/note/reject/100564
Search -- https://master.php.net/manage/user-notes.php