|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2003-07-22 02:25 UTC] derick@php.net
[2003-08-08 07:56 UTC] no dot spam at forme dot pt
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Dec 02 14:00:01 2025 UTC |
Description: ------------ "return ($val);" does not work in a function that returns a reference. "return $val;" is OK. Reproduce code: --------------- class lala { var $val; function lala () { $this->val = 0; } function &get_val () { $inf = 88; $this->val = $inf; return ($inf); } } $obj = new lala; $vvv = &$obj->get_val (); Actual result: -------------- Fatal error: Only variables or references can be returned by reference in /usr/local/apache/site/htdocs/bug.php on line 15