Re: PHP 5.0.3 losing $this
| From: | Yermo Lamers | Date: | Sun, 06 Mar 2005 05:56:42 +0000 |
| Subject: | Re: PHP 5.0.3 losing $this | ||
| References: | 1 2 3 4 5 6 7 8 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-15274@lists.php.net to get a copy of this message | ||
> Yermo,
>
> Essentially, what Andi was saying is that we need your help in order for
> us to help you. To put it more clearly - even if there is a bug in the
> language engine or some other component of PHP - it's impossible for us to
> figure out what it is, unless we're provided with a reproducible test case
> that's small enough to analyze.
yea, like I was saying there are so often cases with PHP that you have a
very specific situation where it's dumping core and you make the
/slightest/ change and it no longer exhibits the problem .. only to crop
up again months later in another very annoying/very specific instance.
In the most extreme case I've seen removing a single character from a
string in an array be the difference between symbol table
corruption/coredump and running fine.
What I'm hearing is that unless I can reproduce it in a small script I
should not bother reporting it. Correct?
>>Maybe there should be a "What to do when you can't reproduce it in a few
>>lines of code" page to help guys like me out.
>
> That's not a bad idea!
It turns out that, at least in this instance, the source of my problem was
incorrectly using parentheses on return()'s when returning references. If
I understand correctly ()'s indicate an expression in this context and
expressions cannot evaluate to references ... what's weird is that I've
been doing it that way for the last 4 years with little ill effect.
It does look like the situation is not being caught correctly, however, as
returning a reference in a parenthetical expression will, under some
circumstances, cause a coredump. I believe because PHP doesn't handle the
"trying to dereference a NULL pointer as an object reference" case
sometimes. (again, random core dump. I don't have a demo script.)
Just an FYI.
Thanks for your time and attention,
-- Yermo
----------------------------------------------------------------------------
DTLink Software http://www.dtlink.com
Desktop Software and Web Applications
----------------------------------------------------------------------------