php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #4280 cannot return a created reference.
Submitted: 2000-04-30 03:28 UTC Modified: 2000-06-06 20:57 UTC
From: andy at qabobala dot xapnet dot com Assigned:
Status: Closed Package: Scripting Engine problem
PHP Version: 4.0 Beta 4 OS: Linux 2.2.14
Private report: No CVE-ID: None
 [2000-04-30 03:28 UTC] andy at qabobala dot xapnet dot com
A function cannot return a reference to a created object.

Bug or intentionally missing feature?  You decide...  

example:

function blah() {
  $stuff = "some really really big string";
  return &$stuff;
}

... parser error.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-06-06 20:57 UTC] andi at cvs dot php dot net
You can do this in the following way (should work)
function &blah()
{
   $stuff = "foo";
   return $stuff;
}
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Jun 28 11:01:30 2024 UTC