Categories
Computing Web Development

PHP 4 Stinks – Reason Number 3008

Yet another reason why PHP 4 reeks to high heaven. XML processing is fraught with bullshit.

Share

PHP sucks ass in a tremendous way.

So I am parsing an XML file with PHP.
The xml file has an element like:
<element>this-is-the-data</element>

Any language worth two cents would return the CDATA of this element as:
this-is-the-data

But PHP – no.

Its native parser – a really fast SAX parser – calls the CDATA handler multiple times, but not in a consistent fashion (for real) – so you cannot just use a call like
$x = $data;
where $x is some variable and $data is the character data the event returned. This will occasionally overwrite $x with the current partial data returned from the parser.
You must use
$x .= $data
which means – “append to $x”.

How f-n stupid is that?! And is this documented ANYWHERE?!!!!!
No.
PHP is enterprise ready like Clay Aiken is straight.

Share
Share