Reply to Re: shortif (tertiary) fails with echo but not print ?

Your name:

Reply:


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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация