diary at Telent Netowrks

For the past few years I've been sneering at PHP#

Wed, 14 Apr 2004 18:06:20 +0000

For the past few years I've been sneering at PHP based mostly on little more than a cursory glance back in the late 1990s sometime. As I recall, after realising it had different database glue functions for each kind of supported database - instead of using some kind of switch a la Perl's DBI - I fairly swiftly decided it wasn't for me. That impression has since been reinforced by Aaron Crane's UKUUG presentation (link above) and Rasmus Lerdorf's infamous comment on compiler technologies.

Well, for one reason and another (day job) it's time to revisit that decision, so expect bits of PHP to be littering this diary in future days. The rules are that I will only be commenting on things which I find either significantly clever or apparently stupid, but I reserve the right to demonstrate apparent stupidity to the world without having first investigating whether said stupidity vests in PHP or in me. So, first up is this entry in php.ini:

; When floats & doubles are serialized store serialize_precision significant
; digits after the floating point. The default value ensures that when
; are decoded with unserialize, the data will remain the same.
serialize_precision = 100

Even supposing that there's some reason the numbers have to be serialised readably and you can't just save the bits (unless PHP is expected to run on non-IEEE systems, I think this is unlikely), it still only takes two minutes with Google to find a better approach.