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

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

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.


Comments?

This blog has no comment-publishing facility: it's all done by hand. Feedback is welcome, though: if you would like to get in touch, email me on comment2010 @ telent . net and I will publish your thoughts (unless you tell me you don't want me to) as an addendum to the article, provided only that in my view they are interesting, amusing, relevant, accurate, or (best) some combination of the four. Relevant links are welcome in support of your argument: spam and untargeted requests for help are not.

telent netowrks

Geeky stuff about what I do. Many include Lisp, Android, Javascript, Linux and matters arising. For my other personality (less tech and more skating/cycling), see coruskate