Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

As a long-time PHP veteran still in the practice:

- Recommend Editor: "Eclipse PDT" [1] probably has the best tools relating to PHP development, although I just use Vim for all of my PHP work.

- Bookmark the PHP online manual [2], and add their search plugin to Firefox, so you can look up standard library functions just by typing it into the search bar.

- The Zend Framework [3], more of a great library than a traditional framework, is probably the best resource for any projects your may be starting from scratch, although CodeIgniter is definitely a top contender.

Probably the best way to learn PHP itself is to read the (rather well-done) PHP manual, which includes everything from an introduction to the language, it's parsing and syntax trees, all the way up to how its object model works, and complete references for the entire function library, and all standard modules.

Read some source code from the wild. I suggest Mediawiki and Drupal.

Key points to make sure you understand:

- Arrays are the archetypal datatype in PHP, and can be used as lists, dictionaries, or a mix of the two.

- You can do just about anything just by using the standard function library. Frameworks are not necessary, contrary to popular belief.

- Objects are a mishmash of arrays, structures, and standard C++/Java objects. You can add class variables, functions, and such at runtime.

- You can do a lot of "fancy" meta-programming in PHP; you just have to know how to accomplish what you want. The PHP library helps out a lot with this.

- Everything is a template. It may be a bit more verbose than compiled templating dialects, but PHP itself is a really handy templating system in it's own right, just using <?php and ?> tags.

[1] http://www.eclipse.org/pdt/

[2] http://www.php.net/manual/en/

[3] http://framework.zend.com/



"- You can do just about anything just by using the standard function library. Frameworks are not necessary, contrary to popular belief."

Up vote for that bullet, specifically for PHP.


As an extended note, I think it important that you understand the underlying concepts behind type inference and type coercion, and then to understand how PHP uses those in various circumstances:

- Convert numbers to strings and vice-versa - Compare strings to numbers - Typeless versus typed comparisons (== and ===) - Array keys using '10' (a string) versus 10 (a number)

Once you understand the type inference and type coercion concepts, it should be simple to pick up how it affects your PHP code.

Most importantly, PHP will generally do what's most logical/useful/expected when it comes to these topics, so you generally don't need to think about it, but you should be aware of it in any case.

A good reference can be found in the PHP manual, which gives you tables of comparisons between different data types in different situations: http://www.php.net/manual/en/types.comparisons.php


When it comes to metaprogramming, PHP's SPL is very handy: http://www.php.net/~helly/php/ext/spl/


Agreed about the Frameworks part. PHP is basically one giant framework that gives you most of what you need (and the few things you it doesn't give you whip up on your own in a few hours and eschew the bloat of the frameworks). That being said, Cake is pretty good.

For an IDE my favorite is PHPDesigner by MPSoftware. Eclipse is pretty good too, just a bit bloated if you like something leaner.



Thank you.




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

Search: