News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Samantha Quinones:
Juggle Chainsaws, Not Types
November 22, 2013 @ 09:25:33

Samantha Quinones has a new post today about something that has been known to trip up both new and experienced PHP developers - PHP's dynamic type juggling.

No matter how popular an activity it is, I really don't like to bash on PHP. Every language has its flaws when you look closely enough, and if PHP wears its idiosyncrasies a little closer to the surface than most, I think it makes up for it in other ways. PHP's handling of types, however, is confusing at best and at worst completely deranged.

She goes on to talk about the issues with type comparisons and how much trouble using the "==" (double equals) versus the "===" (triple equals) can potentially cause. While it's easier for new PHP developers to get caught by this issue, even experienced devs might miss it. She gives an example of a time in her own development involving the comparison of strings against constants and in_array's non-string type comparisons.

0 comments voice your opinion now!
type juggling strict loose comparison inarray

Link: http://www.tembies.com/2013/11/juggle-chainsaws/

blog comments powered by Disqus

Similar Posts

SitePoint PHP Blog: HHVM and Hack - Can We Expect Them to Replace PHP?

Brandon Savage's Blog: An XSS Vulerability In The Making

Anthony Ferrara's Blog: PHP's Source Code For PHP Developers - Part 3 - Variables

Lukas Smith's Blog: Loose interface coupling

Samantha Quinones: Juggle Chainsaws, Not Types


Community Events





Don't see your event here?
Let us know!


laravel opinion composer language symfony voicesoftheelephpant release podcast list community interview introduction configure conference unittest version api install series extension

All content copyright, 2015 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework