Start networking and exchanging professional insights

Register now or log in to join your professional community.

Follow

How to access global php variable inside namespaces?

user-image
Question added by Adel Ezat Fawzy Ellozy , Webdeveloper. , Saudi Arabian Maritiem Sports Federation
Date Posted: 2017/01/16
Parvez Ahmed
by Parvez Ahmed , Frontend Developer (Angular) , GREEN DELTA INSURANCE COMPANY LIMITED

<?phpnamespace foo;$a = new \\stdClass;function test(\\ArrayObject $typehintexample null) {}$a = \\DirectoryIterator::CURRENT_AS_FILEINFO;// extending an internal or global classclass MyException extends \\Exception {}?>

you can learn more in phpdotnet

robert isaac
by robert isaac , frontend team lead , business boomers

use global before start using it

global $global;

 

then use it normally

 

$global++;

More Questions Like This