php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #47121 Cannot suppress warnings for "Call-time pass by reference is deprecated"
Submitted: 2009-01-16 02:33 UTC Modified: 2009-12-18 06:04 UTC
From: david at ethos-consulting dot com Assigned: kalle (profile)
Status: Closed Package: Documentation problem
PHP Version: 5.2.8 OS: MacOS X 10.5.6
Private report: No CVE-ID: None
 [2009-01-16 02:33 UTC] david at ethos-consulting dot com
Description:
------------
I have a legacy PHP4 application running under PHP5 with additional components built in Zend Framework. Several of the legacy classes utilize call-time pass-by-reference when invoking their methods, for historical reasons, which is deprecated behavior in PHP5 and displays a message of level E_WARNING, appropriately:

Warning: Call-time pass-by-reference has been deprecated; If you would like to pass it by reference, modify the declaration of [runtime function name](). If you would like to enable call-time pass-by-reference, you can set allow_call_time_pass_reference to true in your INI file in /path/to/script.php on line ##

I have set and confirmed the error reporting bitmask at 6133 (all minus E_NOTICE and E_WARNING) via .htaccess directives (php_value) and PHP's error_reporting() function. However, I continue to see the warning message on my local development machine. Setting the prescribed ini setting seems to be the only way to suppress the warnings. Are these not regular E_WARNING level messages?

Reproduce code:
---------------
<?php

error_reporting(6133);

function something ( $argument )
{
    echo 'I do nothing...';
} // END something

$variable = '123';

something(&$variable);

Expected result:
----------------
I do nothing...

Actual result:
--------------
Warning: Call-time pass-by-reference has been deprecated; If you would like to pass it by reference, modify the declaration of [something](). If you would like to enable call-time pass-by-reference, you can set allow_call_time_pass_reference to true in your INI file in /path/to/script.php on line 11


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-01-16 11:21 UTC] jani@php.net
It's actually E_COMPILE_WARNING and you can not suppress those from a script, you have to set it in either php.ini or .htaccess. 

This should be mentioned in the documentation.
 [2009-01-16 11:23 UTC] jani@php.net
"This should be mentioned in the documentation." was for mentioning in docs that "allow_call_time_pass_reference" warning's error level is E_COMPILE_WARNING of course. :)
 [2009-12-18 06:04 UTC] svn@php.net
Automatic comment from SVN on behalf of kalle
Revision: http://svn.php.net/viewvc/?view=revision&revision=292279
Log: Fixed bug #47121 (Cannot suppress warnings for "Call-time pass by reference is deprecated")
 [2009-12-18 06:04 UTC] kalle@php.net
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.

Thank you for the report, and for helping us make our documentation better.


 [2020-02-07 06:09 UTC] phpdocbot@php.net
Automatic comment on behalf of kalle
Revision: http://git.php.net/?p=doc/en.git;a=commit;h=76b89a1915c6733fe76e07c3a9d7c34bd5424635
Log: Fixed bug #47121 (Cannot suppress warnings for &quot;Call-time pass by reference is deprecated&quot;)
 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Fri Feb 13 17:00:01 2026 UTC