DomDocument::loadXml not throwing exceptions in PHP

For some reason, Zend have decided not to make PHP throw an exception when you try and load invalid XML into a DomDocument object. This includes XML with invalid characters e.g. &. This means wrapping a try/catch around anything does absolutely no good whatsoever, which is annoying.

Is there a good way of trapping runtime errors using loadXml with the DomDocument library?


Recently a “Husband Super Store” opened where women could go to choose a
husband from among many men. It was laid out over five floors, with the
men increasing in positive attributes as you ascended.

The only rule was, once you opened the door to any floor, you HAD to
choose a man from that floor; if you went up a floor, you couldn’t go
back down except to leave the place, never to return.

A couple of girlfriends went to the shopping centre to find some

First floor

The door had a sign saying, “These men have jobs and love kids.” The
women read the sign and said, “Well, that’s better than not having a job
or not loving kids, but I wonder what’s further up?” So up they went.

Second floor

The sign read, “These men have high paying jobs, love kids, and are
extremely good looking.” “Hmmm,” said the ladies, “But, I wonder what’s
further up?”

Third floor

This sign read, “These men have high paying jobs, are extremely good
looking, love kids and help with the housework.” “Wow,” said the women,
“Very tempting.” But there was another floor, so further up they went. “

Fourth floor

This door had a sign saying “These men have high paying jobs, love kids,
are extremely good looking, help with the housework and have a strong
romantic streak.” “Oh, mercy me,” they cried, “Just think what must be
awaiting us further on! “

So up to the fifth floor they went.

Fifth floor

The sign on that door said, “This floor is empty and exists only to
prove that women are impossible to please. The exit is to your
left. “

Leyton 2-1 Torquay

Leyton 2-1 Torquay

Leyton played superbly against Torquay last night for a well-deserved 3 points at home. There didn’t appear to be a weak link in the team, with the recently back Ibehre providing some dynamism that to-date had only been provided by Echanomi but with much more discipline. His goal was the result of an excellent move between himself and Tudor and he should have had at least another one in the second half.

Alexander also seems on good from after breaking his goal drought and got the first last night and also played a part in quite a few key plays.

This leaves Orient fourth in the table and only 3 points behind leaders Grimsby (“The Carling Cup Spurs Killers”) who they play in just under a month’s time.

BBC SPORT | Football | League Two | Leyton Orient 2-1 Torquay

PHP aaaaarrrrrggggghhhhhh

Things I hate about PHP No. 512 (notwithstanding the fact that in comparison to many other things I like PHP):

Inconsistency in parameter ordering

Say I want to find a small thing in a big thing, like a piece of a string in a bigger string. I can use strpos and you pass in the string you’re looking in first, and the string you want to find second. So strpos(“PHP aaaarrrgggh”,”PHP”) returns 0 (or false, unless you’re using ===, but I’m sure that’s been ranted about enough).

But if I want to find, for example, a key in an array I pass in the key I’m looking for first and the thing to look in second. So I have to remember the exact syntax of every single miniscule stupid little command and which order to pass parameters in because there’s absolutely no consistency.

Telegraph Fantasy Football password

For all those waiting to see if the Carling Cup produced any injuries last night, here’s this week’s Telegraph Fantasy Football Password. Personally, I wish I’d waited to see how poor Spurs were before transferring Defoe in. My team also did pretty poorly last week, not helped by another rack of injuries and a general unwillingness from any of my strikers or midfielders to get anywhere near the goal.

For the week of September 21st the password is RAIN.

Walthamstow Dog Track

Walthamstow Dog Track

I went to Walthamstow Dog Track on Thursday evening. There are rumours it may be turned into a housing estate (as if there aren’t enough of them) so we’ve got to make some effort at keeping it going. The 6-pack deal gives you a scampi (or chicken) and chips, two £1 bets, and 2 drinks (lager, bitter or soft drink. 50p extra if you want Kronenberg instead of Carlsberg). I definitely made a net contribution to their coffers, if only by adding a few pounds. The only winning strategy in our group was to bet on dog 1 in the first race, 2 in the second, 3 in the third etc… right until back to 1 again. I won three times (out of about a dozen bets) but both times were when I had a dog to place (come first or second) when it won, so I would probably have broken even had I made the right bet. Ah well, there was only about a pound in it anyway.

The dog racing is really good fun, though, although the scampi and chips isn’t exactly the most nutritional meal money can buy. I’ll be back again in a couple of weeks time, though, to put another few pounds into the tote’s tills.

Walthamstow Dog Track unveils float price range

888, which owns Pacific Poker, is planning to float on the stock market, probably following the succes that Party Poker’s owners (Partygaming) have had. They’ve set a price which values the company at between £546.1m and £714.6m, although there are rumours that it’s cut its valuation following Partygaming’s profit warning.

For anyone looking to invest in them, I’ve pretty much cashed out, taking out $400 of the $530-odd I have in there (pure profit, at least), and have gotten tired of playing the really awful players that seem to frequent there. It was just becoming too random (being called all-in with a pair of queens and having half a dozen king- or ace-rag callers limping in, and then being beaten by someone calling with 10-3 suited making two pair or some such rubbish). I think I’m sticking to Party Poker from now on, except for perhaps the odd venture with my last $100 at Pacific.

Anyway, 888 are now worth $400 less than they were yesterday so I hope they’ve taken that into account in the valuation.

BBC NEWS | Business | 888 unveils float price range

Pacific Poker

Party Poker