FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » Backslash before function name in PHP
Show: Today's Messages :: Polls :: Message Navigator
Switch to threaded view of this topic Create a new topic Submit Reply
Backslash before function name in PHP [message #172964] Mon, 14 March 2011 02:01 Go to next message
cityuk is currently offline  cityuk
Messages: 1
Registered: March 2011
Karma: 0
Junior Member
Dear All,

I was looking for advanced PHP OO programming tutorials and came
across www.afascripts.com.

They present nice tutorials, but one thing puzzled me: in some of the
code there are backslashes before function names, e.g.:

\spl_autoload_register(array($autoLoader, 'load'));
\class_exists($classname) || \interface_exists($classname)){
if (\file_exists($file)){


(have a look at http://www.afascripts.com/2011/01/07/basics-1-autoloading/#respond).

What does the backslash before the function name do?

Regards,
George
Re: Backslash before function name in PHP [message #172969 is a reply to message #172964] Mon, 14 March 2011 06:31 Go to previous message
Helmut Chang is currently offline  Helmut Chang
Messages: 22
Registered: September 2010
Karma: 0
Junior Member
Am 14.03.2011 03:01, schrieb cityuk:

> They present nice tutorials, but one thing puzzled me: in some of the
> code there are backslashes before function names, e.g.:
>
> \spl_autoload_register(array($autoLoader, 'load'));
> \class_exists($classname) || \interface_exists($classname)){
> if (\file_exists($file)){
>
> [...]
>
> What does the backslash before the function name do?

It's a PHP 5.3 feature:

<http://www.php.net/manual/en/language.namespaces.php>

Helmut
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Keep track of page-access
Next Topic: Stats comp.lang.php (last 7 days)
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sun Nov 10 14:27:18 GMT 2024

Total time taken to generate the page: 0.02577 seconds