note 121045 added to language.namespaces.importing
| From: | xzero at elite7hackers dot net | Date: | Thu, 04 May 2017 11:13:41 +0000 |
| Subject: | note 121045 added to language.namespaces.importing | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-209049@lists.php.net to get a copy of this message | ||
I couldn't find answer to this question so I tested myself.
I think it's worth noting:
<?php
use ExistingNamespace\NonExsistingClass;
use ExistingNamespace\NonExsistingClass as whatever;
use NonExistingNamespace\NonExsistingClass;
use NonExistingNamespace\NonExsistingClass as whatever;
?>
None of above will actually cause errors unless you actually try to use class you tried to import.
<?php
// And this code will issue standard PHP error for non existing class.
use ExistingNamespace\NonExsistingClass as whatever;
$whatever = new whatever();
?>
----
Server IP: 72.52.91.14
Probable Submitter: 212.116.87.108
----
Manual Page -- http://php.net/manual/en/language.namespaces.importing.php
Edit -- https://master.php.net/note/edit/121045
Del: integrated -- https://master.php.net/note/delete/121045/integrated
Del: useless -- https://master.php.net/note/delete/121045/useless
Del: bad code -- https://master.php.net/note/delete/121045/bad+code
Del: spam -- https://master.php.net/note/delete/121045/spam
Del: non-english -- https://master.php.net/note/delete/121045/non-english
Del: in docs -- https://master.php.net/note/delete/121045/in+docs
Del: other reasons-- https://master.php.net/note/delete/121045
Reject -- https://master.php.net/note/reject/121045
Search -- https://master.php.net/manage/user-notes.php