Seems everyone missed the boat...
I thought this was PHP functionality only...?
Anyways...PHP has tons of quirks which have made me go whoa or &@#^&@$(*&
PHP4:
1)
Objects instances are not unique
If you compare (using == or ===) two objects of the same class with the same data they are always the same...this is because PHP doesn't support instances perse in PHP4 - this is corrected in PHP5
I encountered this problem while working on a DOM implementaiton...as it is possible to have a Node object initialized with the same data...
2) Class names are not preserved *exactly* as written but converted to lowercase for whatever reason.
If your framework code relies on your written convention...this can bite you in the a$$
Variable variables caught me by surprise when I first started as I typo-ed a variable wrong and couldn't figure out WTF was going wrong...
PHP Heredoc interesting...albeit hardly useful...at least once I got comfortable to using template engines anyways
Value and Value and Type Comparisons Using === or == was confusing when I started...until I got use to using a loosely typed language...
The ease of use of PHP was frustrating...it introduced a whole new set of problems that a compiler would typically catch...
Mostly...the paradigm shift of desktop application developement to web application development is what was most difficult for me...
Most Windows desktop applications don't require user login, etc...at least not on Win16/32...because of the lack of networks, distributed environments, etc on older Windows desktops...I also never paid much attention to security...filtering data, etc...
Later on, when I started with COM I began to pay attention to things like buffer overflows, etc...
SQL was probably the biggest hurdle for me...as I always start from the bottom and work up when I learn something...I couldn't figure out for the life of me how the hell SQL worked...
Understood it's concept...but needed to understand the underlying engine before I accepted it's use...
Were tables files or were tables stored inside a single database file...were some quqestions I
had to ask...until I switched to PHP I wrote all data access by hand
That was an embarissing moment
Using PHP CLI is interesting if you require some advanced file search and filter...
Last but not least...PHP extensions are a real joy...especially those pointed out to me by Feyd...
The runkit extension lets me emulate Windows hooks...which are very powerful
If you can capture when a function, etc is called, you can do many cool things, such as:
1) Automatically profile your functions without having to enter start and stop code...
2) Generate a call graph of executed functions/methods
3) Disable functions, etc...
http://pecl.php.net/package/runkit
There are many little caveats of PHP which throw me off when I try something that C++ did nicely...but thats a whole different story
Cheers
