You are here: Re: omitting semicolon « PHP Language « IT news, forums, messages
Re: omitting semicolon

Posted by Janwillem Borleffs on 08/23/05 14:47

Kimmo Laine wrote:

> I've been concidering moving from short tags to complete ones. So I'd be
> converting every single <?= "something" ?> to <?php echo "something" ?>. The
> thing is: can I safely omit the semicolon in a single command tag. Or should
> I add it just in case? i.e. <?php echo "something"; ?>. I haven't gotten any
> warnings about it from php if I leave it out in a code, but is there some
> strict mode or any other reason why I should include it. The reason I'm
> asking this is that it seems to work without it, so are there any
> restrictions to it.
>

Yes, in this case you can savely omit the semicolon, as the last line
before the closing PHP tag closes the script:

Valid:
<?php

print 'hello'

?>

Invalid:
<?php

print 'hello'
print 'dosomething';

?>


JW

 

Navigation:

[Reply to this 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

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