Aquarionics

Monday 29th March 2004

Errands and the End Of PHP

Got stuff done.

In this case, the stuff was of a many and varied nature and involved:

  • Sorting out bank accounts
  • Joining Blockbuster
  • Joining Library
  • Posting Stuff

But also:

  • Resolving that I will never again begin a personal project written in PHP.

Yesterday, you see, I managed to get PHP5 working on Atoll, my local server. It works fine, from a technical standpoint, it installed straight into the right place, it works, it access the databases and everything.

Epistula, however, doesn’t. Neither did AqWiki, Aquaintances, Klind or Pareidol. Why?

Because somewhere in the PHP5 development process, somebody wrote a function to return the contents of a directory back as an array, and called it scandir() which, co-incidentally, is the name of my stock function for returning the contents of a directory as an array. It means that, as of PHP5’s full release, my code is broken. This is, in fact, wrong.

One of the great benefits of PHP is it’s integration. Everything available was in the manual, which was searchable and contained the wit and wisdom of several years of PHP developers who had been where you are before you were there.

The greatest flaw PHP has is it’s integration. Functions have been added haphazardly over the five major revisions to the point where, given a two word function, it’s equal odds to be firstSecond() as first_second() depending on who coded it when. Also, the willingness of the development team to break every previous PHP tutorial in a minor revision (Witness the whole REGISTER GLOBALS debacle), Perl – the language with the most established collection of modules on the market – has a namespace system for added on functionality which works so well even Python copied it. PHP, however, is no longer a stable platform to develop releasable code on, since your code may stop working at any point. Worst, this will manifest itself as a PHP syntax error, and you cannot guard against new internal functions unless you check the existence of every function before you use it.

So, PHP, it’s been nice using you, but until you stop fucking around with the namespaces, it’s time to try something new.

Suggestions, anyone?

Those who spoke on this:

gravatar image

Simon Willison:

2004-03-29 17:22 22 mins after the Original Article

mod_python continues to rock my world. I think modules or some other way of avoiding polluting the default namespace is the one feature PHP needs more than anything else – they are up to nearly 3,000 functions now!

Comment Link

gravatar image

Adrian Holovaty:

2004-03-30 04:17 11 hrs after the Original Article

If you really must work in PHP, write a Python code generator that spits out the PHP for you. :-)

Comment Link

gravatar image

Tim Parkin:

2004-03-30 07:39 3 hrs after Adrian Holovaty

Parrot would be nice.. :)

Comment Link

gravatar image

Tim Parkin:

2004-03-30 07:39 3 hrs after Adrian Holovaty

Parrot would be nice.. :)

Comment Link

gravatar image

Tim Parkin:

2004-03-30 07:40 3 hrs after Adrian Holovaty

Parrot would be nice.. :)

Comment Link

gravatar image

Senji:

2004-03-30 09:40 2 hrs after Tim Parkin

Was that supposed to be mindlessly self-referential? :-)

Comment Link

gravatar image

Senji:

2004-03-30 09:46 6 mins after Themself

Is it supposed to say:

“Logging enabled, logged events have been written to the file /tmp/jabberlog.txt.”

Above the banner when I make a reply?

Comment Link

gravatar image

Aquarion:

2004-03-30 10:48 62 mins after Senji

ahem Yes, of course it is.

(Fixed the thing that caused the multiple comments, forgot to turn off logging afterwards)

Comment Link

gravatar image

Gary Fleming:

2004-03-30 13:23 20 hrs after the Original Article

Until PHP gets some proper namespace support, you should try prepending your own namespace function names, in the same way that the output buffering functions do.

Comment Link

gravatar image

SkepticJoe:

2005-01-15 15:12 42 wks after the Original Article

You have to be joking!?

Comment Link

gravatar image

Aquarion:

2005-01-15 16:13 62 mins after SkepticJoe

Joking how?

Joking by skipping out on PHP?

Annoyingly, I’ve been proved wrong. I’ve been doing little but PHP since I wrote that article – professionally now – but I’m still annoyed about how sucessive itterations of PHP will break both my own code and the codebase at work, purely because we didn’t have a crystal ball handy to see which functions the PHP Dev team would include in future releases.

Comment Link


Nicholas 'Aquarion' Avenell is a web developer in London, you can find out more about him or how to get in touch.

There are more Articles, Projects, Journal Entries, Photographs and things that defy description here, too.

If you're looking for something specific, there are Calendar & Category -based lists of everything.

And if you want to follow stuff that appears here, try a Syndication Feed, or the generic Feed of everything.


Aquarion's last Twitter was: [updating]
Twitter last updated


More Journal:

[RSS Icon]
[ESF Icon]
[CDF Icon]

That which is relevant:


Explain Ads
© 2000 to 2008 inclusive Nicholas Avenell
All comments are the property of their creators, published with permission
(Unless otherwise indicated, the opinions and sentiments expressed on this site are those of the author and not of any organisation of which he is an affiliate, including his employer. Caveat Lector, E&OE. sigh)
0.200 seconds, 46 queries, 2.7Mb on Fri, 03 Oct 2008 02:12:16 +0000
Generated by Epistula Version 2.0.3