|
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]
|