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).
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.
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.
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).
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.
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).