Category Archives: PHP

PHPeake?

Just a quick note to say that since announcing my news recently, a rather irreverent post has emerged recommending I name the child Phil Horatio, or Patrick Henry, or Paige Henrietta–anything, really, to ensure the child ends up with the initials PHP. Pretty funny stuff.

Why Oracle?

A recent article asks the same question I have asked on my own blog: “Why PHP?“–but this time, from the angle of an Oracle developer. One of the major conclusions the author makes is that, “it’s not about Oracle programmers choosing a new language; adding PHP is meant to bring more developers to Oracle. Open source developers I would assume. Fair enough.” This begs the question: “Why Oracle?” Not from a developer’s standpoint–but rather, I mean, “Why did Zend partner up with Oracle?”

Continue reading

Net_Monitor Now Growls

Net_Monitor now supports the latest release of Net_Growl (announced yesterday). Growl is an attractive global notification and alert system for OS X. Versions 0.7 and above support remote messaging via UDP, which makes this yet another useful way to receive alerts from the Net_Monitor package about the status of many common services it can monitor. The Net_Monitor_Alert_Growl class is currently available via cvs for your perusal. This and Net_Monitor_Alert_Jabber should be part of the next packaged release of Net_Monitor. For those of you that can’t wait, just pop either of these files into the Net/Monitor/Alert subdirectory of your Pear installation, and Growl or Jabber away.

Has anyone proposed a Net_Jabber package lately?

I was just talking to Jacques Marneweck and was again reminded of my dormant idea to write a Net_Jabber packge for Pear. With Google Talk basically being Jabber and raising the public interest yet again in instant messaging, it might be useful to make this available in Pear. And with PHP 5.1 you should be able to switch the stream context to TLS on-the-fly to handle Jabber’s TLS authentication (haven’t tested this yet, though…) In PHP4 you could use a digest or some other semi-secure mode to authenticate your “client” with the Jabber server.

I was writing a Jabber alerter for Net_Monitor and thought why not do a full-blown Net_Jabber. But, of course, I have no time. Anyone else thought of taking this on?

It’s Official!

Well, it’s offical–my status as a Zend Certified Engineer has been posted to the Zend Yellowpages. Look for my upcoming article in the next issue of PHP Magazine to spell out the gory details of my experience. (Or whet your appetite with some of my musings on this blog–here, here, and here). And, if you’re planning to take the test, be sure to check out my free PHP Function Reference sheet.

Essential PHP Security Coming Soon

Chris Shiflett announced over the weekend that Essential PHP Security is due out next month. This is great news (not only for Chris, who has been hard at work for some time) but the PHP community to finally have what looks like a concise, accurate, actionable guide to one of PHP’s hottest topics: security. I have already preordered my copy from Amazon, and with free shipping it comes to just $27 and should arrive by November 12th. The countdown begins.

Typing PHP

One of the somewhat unique features of PHP is that it is not a strongly typed language. This means that in the event of a type mismatch, variables are automatically cast into whatever variable type (integer, string, etc.) the interpreter deems most appropriate for the operation. Which is typically fine and in fact a boon to most beginning programmers, and fine for experienced programmers that understand the rules of engagement. However, as I was explaining a concept in PHP to a beginning programmer earlier today, it dawned on me that the code he was looking for:

[geshi lang=php]if (in_array($user,$users)) {
//…[/geshi]

could be improved in terms of intelligibility by being written as:

[geshi lang=php]if (in_array($user_string,$users_array)) {
//…[/geshi]

That is, by building in the intentions of the author with regard to the variable type in to the variable name, the code becomes more legible, understandable, and ultimately maintainable.

The same could be done for functions, by appending the return type to the end of the name.

[geshi lang=php]function foo_bool($bar_int, $baz_string) {
//…[/geshi]

In this way, all the basic information you need about the function (return type and variable input types) is available right in the function definition. While it certainly wouldn’t do away with the need for a good description (preferably in a PHPDoc DocBlock) it goes a long way toward explaining the code within the code using simple mnemonics.

Anyone else already using this approach?

PHP Function Reference

One of the giveaways I’m planning to include on the CD-ROM that comes with the issue of PHP Magazine containing my article about the ZCE exam is a color-coded function reference sheet that comes in very handy when studying for the exam. I hadn’t seen this level of concision and focus on core functions available in either the PHP Pocket Reference or other freely available references. So I wrote my own, and used it to prepare for the ZCE.

Enjoy!

Download Now!
(PDF, 124K)

Optimizing, Staticizing, and Caching PHP

Issue 05.05 of International PHP Magazine is out, featuring my article on, “Optimizing, Staticizing, and Caching PHP”. I have written about this topic quite a bit in the past (including here and here) and still consider it an essential part of the greater picture of how to bring PHP into the enterprise as a reliable, fast alternative to solutions like ASP and JSP. This issue should hit newsstands in Europe today, and is available overseas to subscribers.

Pros and Cons of ZCE

If I had to narrow down my assessment of the Zend Certified Engineer exam to just three pros and cons, here is what they would be:

pros

  • bolsters enterprise adoption of PHP with a clear standard for quality developers
  • important, sometimes overlooked concepts like pass-by-reference are covered
  • knowing key functions at the required level of detail can make you code faster

cons

  • need to know some functions by heart does not represent a real-world environment
  • no case study or project, no real free-form responses
  • no publicized passing score means no target to shoot for when studying

The pros are significant and valuable, and the cons could certainly be addressed, for example, with a second, more advanced certification or even by revamping the ZCE. All in all, the very existence of the ZCE is a huge shot in the arm for PHP in the enterprise, where certificates and badges play critical roles in legitimizing not only the developer but her development language of choice.

Written from: Fairmont Hotel, San Jose, CA

ZCE > PHP5?

Here is a bold statement: I believe the existence of the Zend Certified Engineer Program may do more to further PHP in the enterprise than the release of PHP 5. Why? Because while the features PHP 5 introduces put PHP on par with languages like JSP, the truth is that PHP’s popularity was founded on its ability to rapidly deploy web applications. And that is a core focus that not even JSP has caught up with yet. It is the wealth of web-design-specific procedural operations–not the strengthened object model or nuanced handling of data structures–that gets PHP into developer’s minds and therefore in the door of the enterprise. CTOs don’t care about the features of PHP5. They care about adoption, and about use. And they care about certifications that tell them they made the right decision in hiring that new web developer. That is why copying programs like the Sun Certified Programmer For Java with Zend’s own certification program makes good sense to bring PHP to the enterprise.