> -----Original Message-----
> From: Szczepan Hołyszewski [mailto:webmas...@strefarytmu.pl]
> Sent: 26 August 2009 08:48
> Martin Scotta wrote:
> > Fatal error: Call to a member function getAttribute() on a non-
> object in
> > testme.php on line *121*
> Yes, this is _how_ the unmodified script errors out. It is not shown
> in the
> output I attached in my previous message because display_errors is
> Off in my
> php.ini, and the line that sets it to On in my script is commented
> > I'm using a Apache/2.2.3 (Win32) PHP/5.2.6
> I am not using Apache at all. The same error can be seen when I run
> the script
> directly through php on the command line.
> > Is the script correctly? I have removed the "&" in the loop
I really can't see why you'd want to use references in the posted loop anyway
-- it's not likely to gain you any performance, and, as I understand it, may
actually run more slowly than the non-reference version.
> I know that iterating a DOMNode's children using firstChild and
> nextSibling by
> reference causes trouble, thank you. The problem is that it causes
> with objects unrelated to the loop itself, e.g. to variables defined
> the loop has terminated.
I don't think it's possible to answer this for sure without seeing more of the
code -- at least the complete body of the loop, plus as far as any further use
of the variable $child (and any other variables assigned from it).
Electronic Information Developer, Libraries and Learning Innovation,
Leeds Metropolitan University, C507, Civic Quarter Campus,
Woodhouse Lane, LEEDS, LS1 3HE, United Kingdom
Tel: +44 113 812 4730
To view the terms under which this email is distributed, please go to