aartist has asked for the
wisdom of the Perl Monks concerning the following question:

If you have learned PHP after learning a good amount of Perl, you might want to put some thoughts here. I need to learn PHP and I like to know what valueable insight I can get from esteemed monks. I like to know which are the easy areas and which are the difficult areas. How did you do your setup and which are good places that you hang out. I like to know what are the tricks of the trade here.

The good news is PHP looks a lot like Perl, the bad news is PHP looks a lot like Perl.

It's a snap to learn if you know Perl. You won't even need to read any books or anything, you can work with it right now. I do find it annoying that they're so similar you start to get things messed up in your head. Things start blending and you can get confused. The major pitfal is the lack of "use strict". (judging from a lot of questions asked here on PM people aren't using strict, but anyways...)

I don't hang out anywhere for PHP, you don't really need to. You'll find everything you need by Google it when you need it. Everything will be on php.net, and anything else on stackoverflow.

As much as I love Perl and get annoyed with PHP, after working with it a while I do to admit it PHP has some nice features that make basic web development pretty quick. Having the webserver keep track of session data is really nice, and it plays well with mysql.

PHP isn't difficult in the sense that it makes you think hard, like a more terse language like Lisp or something lower-level like assembler. It's difficult in the sense of being annoying and causing extra work, like when you have to look up a function you can't remember because there are way too many and no consistent naming convention. Or when you forget that you have to quote the key in a hash, like $hash['key'] -- except when you don't, like when it's being interpolated in a string between double quotes. Or when you wish you could use Perl's natural-sounding backwards syntax, like next unless $count;

Unpleasant and time-consuming, but not really difficult. If you're capable of programming in Perl, you're certainly capable of using PHP. It has C-style syntax, and it even borrowed Perl's regular expressions (although not every feature of them), so many things will be familiar. Just don't expect it to be as flexible or fun to write in.

I came from the other direction. I fumbled my way through a lot of php (mostly CMS' like Wordpress), got the programming bug and came to Perl. One of the things I felt was that php has A LOT of built-in functions (seemingly more than Perl) for some things that I now don't find difficult to do. I think that's one of the reasons some beginners/web designers may find it easy to jump in to php; you can hack your way through it by plugging in built in functions rather than learning to actually program in it. *(Well, I'll just speak for myself there :) ) I don't know if that's good or bad to you, I simply feel now like it sometimes can be a little bit overkill and inelegant.

I am currently having to learn php myself. In particular I was looking into a frameworks to use that, hopefully, would make things easier for me. I tried Zend and found it complicated and that tutorials beyond 'hello world' didn't work. I am currently looking to http://ezcomponents.org and so far so good.

I use both PHP and perl, mostly perl. The main things that I struggle with aren't so much the multitude of functions (that's no different than using CPAN modules), but really basic syntactic things. I can't tell you the number of times I've typed my $var='X'; in php when I've meant to say $var='X';. Another gotcha is the documentation. PHP is documented fairly well, but often the most useful bits of the documentation are often in the comments thread. Finally, the error messages can be a bit terse sometimes, you get used to that just like with any other language.