php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #16739 `print' variable function call fails.
Submitted: 2002-04-22 23:54 UTC Modified: 2002-07-19 13:53 UTC
Votes:6
Avg. Score:3.2 ± 1.2
Reproduced:4 of 4 (100.0%)
Same Version:2 (50.0%)
Same OS:2 (50.0%)
From: marshall at magpcss dot com Assigned: georg (profile)
Status: Closed Package: Documentation problem
PHP Version: 4.3.0-dev OS: FreeBSD 4.5,RedHat 2.4.7,Win XP
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: marshall at magpcss dot com
New email:
PHP Version: OS:

 

 [2002-04-22 23:54 UTC] marshall at magpcss dot com
According to the official PHP documentation [http://www.php.net/manual/en/functions.variable-functions.php] the language construct `print' can be called as a variable function.  The following code should therefore be valid:

$myfunc = 'print';
$myfunc('My text to print');

Attempting to execute this code on any platform returns a "Fatal error: Call to undefined function:  print()" message.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-05-10 01:32 UTC] philip@php.net
Confirmed with PHP 4.3.0-dev (cgi) (may 09, 2002)
PHP Fatal error:  Call to undefined function:  print() in...

This behavior is documented as working in at least two
places.  These changes to phpdoc were made on March 05,
2002.  So:

  a) Did this used to work?
  b) Will it work in the future?
  c) Should this be documented/undocumented?

I'm guessing it never worked but may in the future.
In the very least, a version of (c) needs to happen.
I can only confirm 4.1.2 through php4-cvs at this time.

print:
http://cvs.php.net/diff.php/phpdoc/en/functions/strings.xml?r1=1.164&r2=1.165

Variable functions:
http://cvs.php.net/diff.php/phpdoc/en/language/functions.xml?r1=1.24&r2=1.25

 [2002-05-10 08:15 UTC] georg@php.net
Its wrong in the documentation. Assigned to myself

 [2002-07-19 13:53 UTC] goba@php.net
18438 was also opened for the same reason. The echo page is also affected. Georg please also correct it.
 [2020-02-07 06:12 UTC] phpdocbot@php.net
Automatic comment on behalf of georg
Revision: http://git.php.net/?p=doc/en.git;a=commit;h=e92e5c946558b57ecb6feacc0fea5a563170d39b
Log: printf can't be used with variable function calls fixed bug #16739
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed Feb 05 16:01:30 2025 UTC