You are here: Re: [NEW] - from Java to PHP « PHP Programming Language « IT news, forums, messages
Re: [NEW] - from Java to PHP

Posted by Toby A Inkster on 05/24/07 13:48

Luigi wrote:

> JAVA:
> boolean isNull = (myObj == null) ? true : false;

That's a particularly poor piece of Java. How about:

boolean isNull = (myObj==null);

> PHP:
> $isNull = ???????????????;

You could use almost the same piece of code in PHP:

$isNull = ($myObj===NULL);

or slightly better:

$isNull = is_null($myObj);

In general, I think you'll find that PHP and Java's syntaxes have more
similarities than differences, owing to the fact that they both were
strongly influenced by C in syntax.

Coming back to your original question, no I don't know of any, though
Google knows of a few pages comparing PHP syntax with Ruby.

--
Toby A Inkster BSc (Hons) ARCS
[Geek of HTML/SQL/Perl/PHP/Python/Apache/Linux]
[OS: Linux 2.6.12-12mdksmp, up 89 days, 21:14.]

The Great Wi-Fi Controversy
http://tobyinkster.co.uk/blog/2007/05/22/wifi-scare/

 

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

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