Heisenbug redux - Grin with cat attached — LiveJournal
Previous Entry Next Entry
Heisenbug redux Aug. 4th, 2005 11:20 am
Calling var_dump() on the two class objects involved stops them from breaking....


ETA: Now solved by colleague

From: babysimon
Date: August 4th, 2005 - 10:42 am (Link)
I'm not a PHP programmer, so this is a guess. Hope I'm not being patronising.

var_dump() says "Arrays and objects are explored recursively with values indented to show structure."

Has somebody created a property get() method (if PHP has that concept) which has side effects? And could those side effects be causing what you're seeing?

And are you absolutely sure there's no race condition?

From: wechsler
Date: August 4th, 2005 - 11:39 am (Link)
It does, but they're not automatic as I think they are in Java. And no, it's not patronising, most things are worth trying when code goes rogue like this.
(no subject) - (Anonymous)
From: wechsler
Date: August 4th, 2005 - 11:37 am (Link)
Won't be going tonight, really don't have the energy. Note that the venue changed in the last couple of days.

Had precisely that issue (and several very similar ones) when I worked at Snell and Wilcox, including several pieces of kit that only worked in the test rig, and one that only worked when someone (according to rumour, one specific person) kept their thumb at a specific point. Apparently it was demonstrated at a trade show that way, and the question was raised of how to replicate the engineer in question, as we'd have to ship one of him with every unit sold.
From: deliberateblank
Date: August 4th, 2005 - 12:02 pm (Link)
You've seen, of course, A Story About 'Magic'?
(no subject) - (Anonymous)
From: wechsler
Date: August 7th, 2005 - 11:35 pm (Link)
get_defined_vars, which $colleague was using to populate class members, behaves differently when called after var_dump, and also differently in PHP4 or 5 (there's an extra first value in one case).

Calling it after var_dump in PHP5 seems to emulate the PHP4 behaviour.