# AW:  return /* by reference */ new Foo() in PHP4

- Thread: https://externals.io/message/19539
- Original archive: https://news-web.php.net/php.internals/19539
- Started by Matthias Pigulla on 2005-10-09T14:36:00+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

---

## #19539 — Matthias Pigulla — 2005-10-09T14:36:00+00:00

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

Hm, thinking a little more about this one:

> > […]

"return false" (or null) is trying to return a reference to a literal,
which is (of course) questionable.

"new fooclass()" is *not* a literal but something that *can* and
*should* be referenced: see
http://www.php.net/manual/en/language.references.whatdo.php.

So at least "return /* byref*/ new ..." should be something that works
without a notice.

Matthias
