Re: warning message to hide

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 4/17/07, Richard Lynch <ceo@xxxxxxxxx> wrote:
On Sat, April 14, 2007 12:12 pm, Tijnema ! wrote:
>> try putting an @ sign before this line. something like this:
>> @$conn = pg_connect($conn_string);
>
> According to the manual:
> http://www.php.net/manual/en/language.operators.errorcontrol.php
> the @ should be placed before the function, so like this:
> $conn = @pg_connect($conn_string);

Actually, the manual explicitly documents the @ operator as being
valid in front of any EXPRESSION.

It goes on to say that if you can get the value of something, you can
use @ on it.

The assignment operator returns a value.

It is an expression.

@$conn = pg_connect($conn_string);

is therefore a documented feature.

Using @ as a long-term solution is stll morally wrong, of course. :-)

Ok, you're right, both are valid. But i think it's better to use it
before the function name. (like all examples in the manual do ).

Else you might end up with code like this:
my_function(@$var);

Which will result in a parse error...

Tijnema

--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux