Debian Bug report logs - #647641
PHP missing E_COMPILE_DEPRECATED error level

version graph

Package: php5; Maintainer for php5 is (unknown);

Reported by: Filipus Klutiero <[email protected]>

Date: Fri, 4 Nov 2011 19:48:01 UTC

Severity: wishlist

Found in version php5/5.3.8-2

Fixed in version php5/5.4.0-1

Done: Ondřej Surý <[email protected]>

Bug is archived. No further changes may be made.

Forwarded to https://bugs.php.net/bug.php?id=61031

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to [email protected], Debian PHP Maintainers <[email protected]>:
Bug#647641; Package php5. (Fri, 04 Nov 2011 19:48:04 GMT) (full text, mbox, link).


Acknowledgement sent to Filipus Klutiero <[email protected]>:
New Bug report received and forwarded. Copy sent to Debian PHP Maintainers <[email protected]>. (Fri, 04 Nov 2011 19:48:04 GMT) (full text, mbox, link).


Message #5 received at [email protected] (full text, mbox, reply):

From: Filipus Klutiero <[email protected]>
To: [email protected]
Subject: [php5] call-time pass-by-reference does not generate notice/error
Date: Fri, 04 Nov 2011 15:47:08 -0400
[Message part 1 (text/plain, inline)]
Package: php5
Version: 5.3.8-2
Severity: normal

Call to functions with arguments passed by reference are deprecated 
since PHP 5.3. However, these do not trigger a notice/error. There is an 
option to allow these calls without causing notices 
(allow_call_time_pass_reference) but it is not enabled here.

I created a test script for that which I'm attaching. I'm attaching its 
output and errors too. The split() call simply confirms that the problem 
is not that E_DEPRECATED is not set.

I asked other people on ##php to test and they reported their PHP 
generated notices for the pass-by-reference call script, as expected. 
These 2 people pasted their results, which may still be available on 
http://codepad.viper-7.com/303dgf and http://codepad.viper-7.com/iiYsph
Note that these were running an earlier version of the script. Their 
output contains:

> *Deprecated*: Call-time pass-by-reference has been deprecated; If you 
> would like to pass it by reference, modify the declaration of foo(). 
> 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 
> */code/iiYsph* on line *8*

I tested on a squeeze server and reproduced the issue. I also asked on 
#debian and another user reproduced also using squeeze.

--- System information. ---
Architecture: i386
Kernel: Linux 3.0.0-2-amd64

Debian Release: wheezy/sid
990 testing security.debian.org
990 testing ftp.ca.debian.org
500 unstable ftp.ca.debian.org
1 experimental ftp.ca.debian.org

--- Package information. ---
Depends (Version) | Installed
===========================================-+-==============
libapache2-mod-php5 (>= 5.3.8-2) | 5.3.8-2
OR libapache2-mod-php5filter (>= 5.3.8-2) |
OR php5-cgi (>= 5.3.8-2) |
OR php5-fpm (>= 5.3.8-2) |
php5-common (>= 5.3.8-2) | 5.3.8-2


Package's Recommends field is empty.

Package's Suggests field is empty.



[Message part 2 (text/html, inline)]
[callTimeRefNoticeTest.php (application/x-httpd-php, attachment)]
[callTimeRefNoticeTestStderr.txt (text/plain, attachment)]
[callTimeRefNoticeTestStdout.txt (text/plain, attachment)]

Reply sent to Ondřej Surý <[email protected]>:
You have taken responsibility. (Wed, 08 Feb 2012 19:45:06 GMT) (full text, mbox, link).


Notification sent to Filipus Klutiero <[email protected]>:
Bug acknowledged by developer. (Wed, 08 Feb 2012 19:45:06 GMT) (full text, mbox, link).


Message #10 received at [email protected] (full text, mbox, reply):

From: Ondřej Surý <[email protected]>
To: [email protected]
Subject: Not a bug
Date: Wed, 8 Feb 2012 20:43:21 +0100
Version: 5.3.8-2

This is not a bug. You set the error_reporting = E_ALL after this
message would be printed.

ondrej@howl:~$ php -v
PHP 5.3.3-7+squeeze7 with Suhosin-Patch (cli) (built: Feb  2 2012 17:32:55)
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies

$ php -c /usr/share/doc/php5-common/examples/php.ini-development
/tmp/callTimeRefNoticeTest.php
PHP Deprecated:  Call-time pass-by-reference has been deprecated; If
you would like to pass it by reference, modify the declaration of
foo().  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
/tmp/callTimeRefNoticeTest.php on line 10

Deprecated: Call-time pass-by-reference has been deprecated; If you
would like to pass it by reference, modify the declaration of foo().
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
/tmp/callTimeRefNoticeTest.php on line 10
PHP Deprecated:  Function split() is deprecated in
/tmp/callTimeRefNoticeTest.php on line 11

Deprecated: Function split() is deprecated in
/tmp/callTimeRefNoticeTest.php on line 11
DONE

O.




Information forwarded to [email protected], Debian PHP Maintainers <[email protected]>:
Bug#647641; Package php5. (Thu, 09 Feb 2012 02:42:06 GMT) (full text, mbox, link).


Acknowledgement sent to Filipus Klutiero <[email protected]>:
Extra info received and forwarded to list. Copy sent to Debian PHP Maintainers <[email protected]>. (Thu, 09 Feb 2012 02:42:06 GMT) (full text, mbox, link).


Message #15 received at [email protected] (full text, mbox, reply):

From: Filipus Klutiero <[email protected]>
To: [email protected], [email protected]
Subject: Re: Not a bug
Date: Wed, 08 Feb 2012 21:38:07 -0500
[Message part 1 (text/plain, inline)]
reopen 647641
retitle 647641 call-time pass-by-reference notice/error is generated at 
compile time
tags 647641 + upstream fixed-upstream
close 647641 5.4.0~rc7-1
thanks

Hi Ondřej,

On -28163-01--10 14:59, Ondřej Surý wrote:
> Version: 5.3.8-2
>
> This is not a bug. You set the error_reporting = E_ALL after this
> message would be printed.

The call is on line 10, after the error_reporting() call on line 6.
>
> ondrej@howl:~$ php -v
> PHP 5.3.3-7+squeeze7 with Suhosin-Patch (cli) (built: Feb  2 2012 17:32:55)
> Copyright (c) 1997-2009 The PHP Group
> Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies
>
> $ php -c /usr/share/doc/php5-common/examples/php.ini-development
> /tmp/callTimeRefNoticeTest.php
> PHP Deprecated:  Call-time pass-by-reference has been deprecated; If
> you would like to pass it by reference, modify the declaration of
> foo().  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
> /tmp/callTimeRefNoticeTest.php on line 10
>
> Deprecated: Call-time pass-by-reference has been deprecated; If you
> would like to pass it by reference, modify the declaration of foo().
> 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
> /tmp/callTimeRefNoticeTest.php on line 10
> PHP Deprecated:  Function split() is deprecated in
> /tmp/callTimeRefNoticeTest.php on line 11
>
> Deprecated: Function split() is deprecated in
> /tmp/callTimeRefNoticeTest.php on line 11
> DONE
>
> O.
>

Thanks for that. I re-tested and was able to reproduce your result. I 
figured out that the bug is not what I thought. The problem is that this 
is actually a compile-time notice. Therefore, the error_reporting() call 
has no effect. I am attaching a new version of the script that shows 
this more clearly. The script does 3 calls, the first at the default 
error reporting level, one with error reporting disabled and one with 
error reporting enabled. But as you can see, the notice will actually 
show 0 or 3 times:

> $ php -n callTimeRefNoticeTest.php ;php -n --define 
> 'error_reporting=E_ALL|E_STRICT' --define 
> allow_call_time_pass_reference=Off callTimeRefNoticeTest.php
> display_errors = 1
> error_reporting =
> allow_call_time_pass_reference = 1
> Array
> (
> [type] => 8192
> [message] => Function split() is deprecated
> [file] => /var/www/callTimeRefNoticeTest.php
> [line] => 22
> )
>
> Deprecated: Function split() is deprecated in 
> /var/www/callTimeRefNoticeTest.php on line 28
>
> DONE
>
> Deprecated: Call-time pass-by-reference has been deprecated; If you 
> would like to pass it by reference, modify the declaration of foo(). 
> 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 
> /var/www/callTimeRefNoticeTest.php on line 16
>
> Deprecated: Call-time pass-by-reference has been deprecated; If you 
> would like to pass it by reference, modify the declaration of foo(). 
> 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 
> /var/www/callTimeRefNoticeTest.php on line 21
>
> Deprecated: Call-time pass-by-reference has been deprecated; If you 
> would like to pass it by reference, modify the declaration of foo(). 
> 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 
> /var/www/callTimeRefNoticeTest.php on line 26
> Array
> (
> [type] => 8192
> [message] => Call-time pass-by-reference has been deprecated; If you 
> would like to pass it by reference, modify the declaration of foo(). 
> 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
> [file] => /var/www/callTimeRefNoticeTest.php
> [line] => 26
> )
> display_errors = 1
> error_reporting = 32767
> allow_call_time_pass_reference =
>
> Deprecated: Function split() is deprecated in 
> /var/www/callTimeRefNoticeTest.php on line 17
> Array
> (
> [type] => 8192
> [message] => Function split() is deprecated
> [file] => /var/www/callTimeRefNoticeTest.php
> [line] => 22
> )
>
> Deprecated: Function split() is deprecated in 
> /var/www/callTimeRefNoticeTest.php on line 28
>
> DONE
> chealer@vinci:/var/www$

8192 is E_DEPRECATED: http://ca2.php.net/manual/en/errorfunc.constants.php

As explained in 
http://www.php.net/manual/en/ini.core.php#ini.allow-call-time-pass-reference 
E_DEPRECATED is what should happen on PHP 5.3.

I reproduced this on PHP 5.3.8 on Windows, so this is clearly an 
upstream issue. However, PHP 5.4 should be released very soon, and this 
problem disappears with it, as call-time passes by reference are now 
illegal:

> Fatal error: Call-time pass-by-reference has been removed; If you would like to pass argument by reference, modify the declaration of foo(). in /var/www/callTimeRefNoticeTest.php on line 16

Therefore, I am not going to bother forwarding this and am simply 
marking this as fixed in PHP 5.4.

[callTimeRefNoticeTest.php (application/x-httpd-php, attachment)]

Set Bug forwarded-to-address to 'https://bugs.php.net/bug.php?id=61031'. Request was from Ondřej Surý <[email protected]> to [email protected]. (Thu, 09 Feb 2012 17:18:05 GMT) (full text, mbox, link).


Severity set to 'wishlist' from 'normal' Request was from Ondřej Surý <[email protected]> to [email protected]. (Thu, 09 Feb 2012 17:18:06 GMT) (full text, mbox, link).


Changed Bug title to 'PHP missing E_COMPILE_DEPRECATED error level' from '[php5] call-time pass-by-reference does not generate notice/error' Request was from Ondřej Surý <[email protected]> to [email protected]. (Thu, 09 Feb 2012 17:18:07 GMT) (full text, mbox, link).


Bug No longer marked as fixed in versions 5.3.8-2 and reopened. Request was from Debbugs Internal Request <[email protected]> to [email protected]. (Thu, 09 Feb 2012 17:18:07 GMT) (full text, mbox, link).


Marked as fixed in versions php5/5.4.0-1. Request was from Ondřej Surý <[email protected]> to [email protected]. (Tue, 22 May 2012 08:09:05 GMT) (full text, mbox, link).


Marked Bug as done Request was from Ondřej Surý <[email protected]> to [email protected]. (Thu, 23 Aug 2012 09:45:04 GMT) (full text, mbox, link).


Notification sent to Filipus Klutiero <[email protected]>:
Bug acknowledged by developer. (Thu, 23 Aug 2012 09:45:05 GMT) (full text, mbox, link).


Bug archived. Request was from Debbugs Internal Request <[email protected]> to [email protected]. (Fri, 21 Sep 2012 07:33:00 GMT) (full text, mbox, link).


Send a report that this bug log contains spam.


Debian bug tracking system administrator <[email protected]>. Last modified: Wed Dec 24 04:27:02 2025; Machine Name: berlioz

Debian Bug tracking system

Debbugs is free software and licensed under the terms of the GNU General Public License version 2. The current version can be obtained from https://bugs.debian.org/debbugs-source/.

Copyright © 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson, 2005-2017 Don Armstrong, and many other contributors.