Hacker News new | past | comments | ask | show | jobs | submit login

Switching languages, for me, has usually been a matter of remembering syntax, some minor differences (such as how arrays work, what things are built-in, etc), and the patterns in each language that naturally arise from those two. Of course, things get more complicated if the language itself is structured differently (eg: Javascript), but there are a lot of underlying concepts that carry over (scope, stack, OOP, etc). In short, it just takes practice. If you're "advanced", you should be able to pick up on it pretty quickly.

To get a feel for syntax and how PHP works (especially == and reference/value), you should read the docs. They're a breeze and provide lots and lots of examples. The user comments are generally incredibly helpful and will notify you of caveats that you might need to be aware of.

You'll also want to start off by learning how to build objects in PHP, how associative arrays work (they are great), and how to use __autoload() to include classes on the fly.




Magic quotes is also worth a mention. It's bound to throw anyone coming from another language for a loop.


Magic quotes has been disabled by default for several years. All you need to know about them are: disable them if enabled.


And if you can't guarantee they're disabled (e.g, if you're writing code to be used by other people), undo them at runtime as early as possible.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: