NYCPHP Meetup

NYPHP.org

[nycphp-talk] Why do "cool kids" choose PHP to build websites instead of Java

Jake McGraw jmcgraw1 at gmail.com
Thu Jan 3 09:29:47 EST 2008


I believe it was my Uncle Ben who once said "With great power comes great
responsibility." PHP does things in a manner different than C or Java or
Python or etc etc etc (that is why it is called PHP). There are features
that some programmers believe are shortcomings, there are shortcomings that
some programmers believe are features. Know the language and its quirks and
you'll never get bitten, program with some "responsibility".

- jake

On Jan 3, 2008 9:14 AM, Anthony Wlodarski <aw at sap8.com> wrote:

> Zesty Ping never learned === apparently.  This one's for you Zesty:
>
> http://www.php.net/manual/en/language.operators.comparison.php
>
> "===" introduced type facing in php4 so it is a moot point or just poor
> reading skills on some developers parts if they missed this essential
> comparison operator...
>
> Anthony Wlodarski
> 646-285-0500 x230
> aw at sap8.com
>
> -----Original Message-----
> From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org]
> On Behalf Of Gary Mort
> Sent: Thursday, January 03, 2008 5:14 AM
> To: NYPHP Talk
> Subject: Re: [nycphp-talk] Why do "cool kids" choose PHP to build websites
> instead of Java
>
> Elliotte Rusty Harold wrote:
> > % cat equality.php
> > <?php
> >
> > $a = 0;
> > $b = "eggs";
> > $c = "spam";
> >
> > print ($a == $b) ? "a == b\n" : "a != b\n";
> > print ($b == $c) ? "b == c\n" : "b != c\n";
> > print ($a == $c) ? "a == c\n" : "a != c\n";
> > print ($a == $d) ? "a == d\n" : "a != d\n";
> > print ($b == $d) ? "b == d\n" : "b != d\n";
> > print ($c == $d) ? "c == d\n" : "c != d\n";
> > ?>
> >
> I don't see this as a problem, basically the issue being raised is:
> PHP does not have strong typing, this 0, NULL, and false are all
> equivalent(add a $d=false; to the definitions and everything still comes
> out with the same result).
>
> However, knowing that these 3 values are considered the same, you can
> replace 2 equal signs with 3, ===, and get the output your expecting.
> _______________________________________________
> New York PHP Community Talk Mailing List
> http://lists.nyphp.org/mailman/listinfo/talk
>
> NYPHPCon 2006 Presentations Online
> http://www.nyphpcon.com
>
> Show Your Participation in New York PHP
> http://www.nyphp.org/show_participation.php
>
>
>
> _______________________________________________
> New York PHP Community Talk Mailing List
> http://lists.nyphp.org/mailman/listinfo/talk
>
> NYPHPCon 2006 Presentations Online
> http://www.nyphpcon.com
>
> Show Your Participation in New York PHP
> http://www.nyphp.org/show_participation.php
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.nyphp.org/pipermail/talk/attachments/20080103/382c8da9/attachment.html>


More information about the talk mailing list