I ran across Cedric Otaku’s blog entry about his first impressions working with PHP as an experienced Java programmer. Not surprisingly, he chose PHP partly because it was already available on his ISP.
He highlights syntax, available libraries and string handling as PHP’s strengths.
He has some problems with the scoping rules and with the lack of namespaces.
Reading between the lines, I also wonder if he might prefer a stricter error_reporting setting.
Perhaps as a PHP advocacy issue it might be helpful to have a ‘PHP for Java programmers’ chapter of the PHP manual on php.net. I’m not sure how far something like this might go, but the seed seems to be there. A while ago, I started to compare the PHP response handling to Java’s HttpServletResponse. Request Handling is here.
A comment on this post is disturbing. It calls PHP ‘dangerous’ from a security perspective because of the recent phpBB vulnerability. To be fair, I have to admit that the /e modifier of preg_replace is obscure. (I’ve started compiling a list of Security Sensitive Functions in PHP.)
Hi Jeff,
Indeed, a stricter error reporting is quite useful, but I suppose I’ll have to set it in my PHP code since my ISP will most likely not let me edit their PHP.ini.
Thanks for the comment.
–
Cedric