php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #49661 namespace backslash is incorrect in example
Submitted: 2009-09-24 19:21 UTC Modified: 2009-09-25 22:20 UTC
From: kent at marketruler dot com Assigned:
Status: Not a bug Package: Documentation problem
PHP Version: 5.3.0 OS: n/a
Private report: No CVE-ID: None
 [2009-09-24 19:21 UTC] kent at marketruler dot com
Description:
------------
Need to properly quote backslash in example in call_user_func_array

Reproduce code:
---------------
---
From manual page: function.call-user-func-array
---
// As of PHP 5.3.0
call_user_func_array(__NAMESPACE__ .'\Foo::test', array('Hannes'));

// As of PHP 5.3.0
call_user_func_array(array(__NAMESPACE__ .'\Foo', 'test'), array('Philip'));

SHOULD BE:

// As of PHP 5.3.0
call_user_func_array(__NAMESPACE__ .'\\Foo::test', array('Hannes'));

// As of PHP 5.3.0
call_user_func_array(array(__NAMESPACE__ .'\\Foo', 'test'), array('Philip'));



Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-09-25 07:39 UTC] rquadling@php.net
Seems not to be the case.

I even changed the code so Foo was noo (\noo).

Output is as documented.

NFF.
 [2009-09-25 07:39 UTC] rquadling@php.net
Example works as documented.
 [2009-09-25 16:40 UTC] bjori@php.net
in single quotes you only have to escape ', no other characater.
 [2009-09-25 22:20 UTC] kent at marketruler dot com
Whoops; sorry for the mistake. My bad.
 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Thu Oct 08 10:00:01 2026 UTC