Why don't I get a deprecation warning? [message #170625] |
Thu, 11 November 2010 21:14 |
Roy Smith
Messages: 11 Registered: November 2010
Karma: 0
|
Junior Member |
|
|
I'm running:
PHP 5.3.2-1ubuntu4.5 with Suhosin-Patch (cli) (built: Sep 17 2010
13:49:46)
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies
with XCache v1.3.0, Copyright (c) 2005-2009, by mOo
I have a little test file which contains just:
<?php
$matches = array();
preg_match('/pattern/', 'string', &$matches);
?>
I was expecting when I run it (with "php try.php"), I would get a
deprecation warning about the call-time pass by reference. I don't.
I get the deprecation warning from similar code (which is part of a
large application) when run under apache. Why don't I get the warning
when I run this test case on the command line?
|
|
|
Re: Why don't I get a deprecation warning? [message #170626 is a reply to message #170625] |
Thu, 11 November 2010 21:56 |
Jerry Stuckle
Messages: 2598 Registered: September 2010
Karma: 0
|
Senior Member |
|
|
On 11/11/2010 4:14 PM, Roy Smith wrote:
> I'm running:
>
> PHP 5.3.2-1ubuntu4.5 with Suhosin-Patch (cli) (built: Sep 17 2010
> 13:49:46)
> Copyright (c) 1997-2009 The PHP Group
> Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies
> with XCache v1.3.0, Copyright (c) 2005-2009, by mOo
>
> I have a little test file which contains just:
>
> <?php
> $matches = array();
> preg_match('/pattern/', 'string',&$matches);
> ?>
>
> I was expecting when I run it (with "php try.php"), I would get a
> deprecation warning about the call-time pass by reference. I don't.
>
> I get the deprecation warning from similar code (which is part of a
> large application) when run under apache. Why don't I get the warning
> when I run this test case on the command line?
>
>
What are error_reporting and display_errors set to in your php.ini file?
(Check phpinfo() to be sure.)
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex(at)attglobal(dot)net
==================
|
|
|
Re: Why don't I get a deprecation warning? [message #170627 is a reply to message #170626] |
Thu, 11 November 2010 22:06 |
Roy Smith
Messages: 11 Registered: November 2010
Karma: 0
|
Junior Member |
|
|
On Nov 11, 4:56 pm, Jerry Stuckle <jstuck...@attglobal.net> wrote:
> What are error_reporting and display_errors set to in your php.ini file?
> (Check phpinfo() to be sure.)
display_errors => Off => Off
error_reporting => 22527 => 22527
|
|
|
Re: Why don't I get a deprecation warning? [message #170628 is a reply to message #170627] |
Thu, 11 November 2010 22:32 |
Roy Smith
Messages: 11 Registered: November 2010
Karma: 0
|
Junior Member |
|
|
On Nov 11, 5:06 pm, Roy Smith <r...@panix.com> wrote:
> On Nov 11, 4:56 pm, Jerry Stuckle <jstuck...@attglobal.net> wrote:
>
>> What are error_reporting and display_errors set to in your php.ini file?
>> (Check phpinfo() to be sure.)
>
> display_errors => Off => Off
> error_reporting => 22527 => 22527
For what it's worth, this doesn't print anything either:
<?php
ini_set('display_errors', 1);
error_reporting(E_ALL|E_STRICT);
$matches = array();
preg_match('/pattern/', 'string', &$matches);
?>
If I stick in some other kind of error (such as "echo $x;", where $x
is undefined), it does report that error...
php try.php
PHP Notice: Undefined variable: x in /home/roy/play/php/try.php on
line 6
Notice: Undefined variable: x in /home/roy/play/php/try.php on line 6
So, I think the problem is not so much the error reporting, as the
error not getting generated in the first place. Is there some magic
setting which determines if call-time call by value expressions
generate warnings or not?
|
|
|
Re: Why don't I get a deprecation warning? [message #170629 is a reply to message #170628] |
Thu, 11 November 2010 23:00 |
Michael Fesser
Messages: 215 Registered: September 2010
Karma: 0
|
Senior Member |
|
|
.oO(Roy Smith)
> So, I think the problem is not so much the error reporting, as the
> error not getting generated in the first place. Is there some magic
> setting which determines if call-time call by value expressions
> generate warnings or not?
Check the 'allow_call_time_pass_reference' setting.
Micha
|
|
|
Re: Why don't I get a deprecation warning? [message #170630 is a reply to message #170629] |
Fri, 12 November 2010 00:00 |
Roy Smith
Messages: 11 Registered: November 2010
Karma: 0
|
Junior Member |
|
|
On Nov 11, 6:00 pm, Michael Fesser <neti...@gmx.de> wrote:
> .oO(Roy Smith)
>
>> So, I think the problem is not so much the error reporting, as the
>> error not getting generated in the first place. Is there some magic
>> setting which determines if call-time call by value expressions
>> generate warnings or not?
>
> Check the 'allow_call_time_pass_reference' setting.
>
> Micha
$ php -r 'phpinfo();' | grep reference
allow_call_time_pass_reference => Off => Off
|
|
|