php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #71697 Shouldn't call_user_func() be named call()?
Submitted: 2016-03-01 15:46 UTC Modified: 2016-03-01 22:28 UTC
From: kak dot serpom dot po dot yaitsam at gmail dot com Assigned:
Status: Wont fix Package: *General Issues
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: kak dot serpom dot po dot yaitsam at gmail dot com
New email:
PHP Version: OS:

 

 [2016-03-01 15:46 UTC] kak dot serpom dot po dot yaitsam at gmail dot com
Description:
------------
Summary will do.


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2016-03-01 22:12 UTC] requinix@php.net
-Status: Open +Status: Wont fix
 [2016-03-01 22:12 UTC] requinix@php.net
It's not just for user functions, true, but it's a bit late to change its name now.
 [2016-03-01 22:14 UTC] kak dot serpom dot po dot yaitsam at gmail dot com
Why not make an alias?
 [2016-03-01 22:17 UTC] nikic@php.net
To add to that, you oughtn't be using call_user_func() at all and instead just use the normal $func() syntax. The only reason to use call_user_func() is backwards compatibility, so an alias would be utterly pointless.
 [2016-03-01 22:28 UTC] kak dot serpom dot po dot yaitsam at gmail dot com
There's a difference: call_user_func() doesn't raise Fatal Error if the argument is not callable. In PHP 7 these errors are catchable, though. So yeah, I should just switch to PHP 7 and $func().
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sun Jul 06 11:02:27 2025 UTC