Note to self
13th August 2003
When writing an XML parsing class in PHP, don’t forget the ampersands in the following code snippet:
xml_set_element_handler($parser, array(&$this, '_tagOpen'), array(&$this, '_tagClose'));
xml_set_character_data_handler($parser, array(&$this, '_cdata'));
Failure to include them can lead to two days of debugging, frustration and hair loss. Solution found thanks to Keith’s PHP rant (which itself reads like the result of several days of hell). Roll on PHP 5, where objects are passed by reference by default.
More recent articles
- Qwen2.5-Coder-32B is an LLM that can code well that runs on my Mac - 12th November 2024
- Visualizing local election results with Datasette, Observable and MapLibre GL - 9th November 2024
- Project: VERDAD - tracking misinformation in radio broadcasts using Gemini 1.5 - 7th November 2024