# PHP 5.0.3 losing $this bug 31508 and PHP 4.3.10 spinning bug 31525

- Thread: https://externals.io/message/15275
- Original archive: https://news-web.php.net/php.internals/15275
- Started by Yermo Lamers on 2005-03-06T06:05:15+00:00
- Messages: 1
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #15275 — Yermo Lamers — 2005-03-06T06:05:15+00:00

URL: https://externals.io/message/15275#15275

Just to followup on today's threads on both the strange PHP 4.3.10 apache
coredump/sitting and spinning in malloc() bug #31508 and the losing $this
variable bug 31525.

Both, it turns out, were caused because I was returning references inside
parenthetical expression on return(). i.e.

function &somefunc()
{
return( $somevar )
}

In the test case, PHP 5.0.3 with `E_STRICT` turned on correctly identified
this as an error. However, running the full body of code I have through it
/did not/.

I went through and replaced all my return( xxx ); calls to return xxx; and
retried. Under PHP 5.0.3 it ran like a champ. And to my surprise the PHP
4.3.10 sitting/spinning/coredump problem I had noticed also disappeared (I
had a very specific setup that was reproducing the problem consistently.)

If return( $this ) is not correct for a function returning a reference, it
seems to me both PHP 4.3 and PHP 5 should generate some kind of error
message even without E_STRICT.

thanks again for everyones help,

-- Yermo

----------------------------------------------------------------------------
DTLink Software                                 http://www.dtlink.com
       Desktop Software and Web Applications
