FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » Why don't I get a deprecation warning?
Show: Today's Messages :: Polls :: Message Navigator
Switch to threaded view of this topic Create a new topic Submit Reply
Why don't I get a deprecation warning? [message #170625] Thu, 11 November 2010 21:14 Go to next message
Roy Smith is currently offline  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 Go to previous messageGo to next message
Jerry Stuckle is currently offline  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 Go to previous messageGo to next message
Roy Smith is currently offline  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 Go to previous messageGo to next message
Roy Smith is currently offline  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 Go to previous messageGo to next message
Michael Fesser is currently offline  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 Go to previous message
Roy Smith is currently offline  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
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: ANNOUNCE: NHI1-0.9, PLMK-1.7 und libmsgque-4.7
Next Topic: where else can this list be found?
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Tue Nov 26 10:31:50 GMT 2024

Total time taken to generate the page: 0.03448 seconds