|
Posted by Tyno Gendo on 05/02/07 08:35
Rami Elomaa wrote:
> Tyno Gendo kirjoitti:
>> I have just written a line of code like this (yes, many people think
>> this stinks bad):
>>
>> <?php true == isset($page_seq) ? echo "$page_seq" : false; ?>
>
> You could make this shorter ;)
>
> <?php isset($page_seq) && print($page_seq) ?>
>
> But why not just:
> <?php @echo $page_seq; ?>
> If it's not set, it's not gonna print anything either, why bother testing?
>
I'm using a custom error handler and the @ doesn't seem to be supressing
errors, don't know why. However, I would prefer to handle all errors
correctly rather than supressing as sometimes I've found in the past
that I've supressed some errors and then found it hard to locate what's
going wrong in a script whereas I would have been fully aware if I
hadn't supressed errors in the first place :S
I know trying to handle as many errors as possible might have a slight
performance hit perhaps, but nothing major.
[Back to original message]
|