note 126073 added to language.namespaces.rationale
| From: | shewa12kpi at gmail dot com | Date: | Wed, 12 May 2021 16:39:59 +0000 |
| Subject: | note 126073 added to language.namespaces.rationale | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-216377@lists.php.net to get a copy of this message | ||
<?php
//Here is the simple use case of namespace. See how we can use same named class with the help of
namespace. This is how namespace resolve naming collision.
namespace Mobile;
class User
{
public $name = 'mobile user';
}
$user = new \Mobile\User;
echo $user->name;
namespace TV ;
class User
{
public static $name = 'tv user';
}
echo \TV\User::$name;
----
Server IP: 45.112.84.4
Probable Submitter: 45.112.85.242 (proxied: 103.25.248.234)
----
Manual Page -- https://php.net/manual/en/language.namespaces.rationale.php
Edit -- https://main.php.net/note/edit/126073
Del: integrated -- https://main.php.net/note/delete/126073/integrated
Del: useless -- https://main.php.net/note/delete/126073/useless
Del: bad code -- https://main.php.net/note/delete/126073/bad+code
Del: spam -- https://main.php.net/note/delete/126073/spam
Del: non-english -- https://main.php.net/note/delete/126073/non-english
Del: in docs -- https://main.php.net/note/delete/126073/in+docs
Del: other reasons-- https://main.php.net/note/delete/126073
Reject -- https://main.php.net/note/reject/126073
Search -- https://main.php.net/manage/user-notes.php