|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2001-08-17 09:26 UTC] derick@php.net
[2012-08-13 21:20 UTC] nikic@php.net
[2012-08-13 21:20 UTC] nikic@php.net
-Status: Suspended
+Status: Closed
-Package: Feature/Change Request
+Package: *General Issues
-Assigned To:
+Assigned To: nikic
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Nov 03 20:00:02 2025 UTC |
In a class I often use functions like this to get/set variables: class example { var $somevar; function Somevar($arg = NULL) { if (!is_null($arg)) $this->somevar = $arg; return $this->somevar; } } Everything is ok, but sometimes I would like to be able to do the same with references, like so: class example2 { var $someobject; function &Someobject(&$arg = NULL) { if (!is_null($arg)) $this->someobject = &$arg; return $this->someobject; } } The second example will throw an parse error, expecting ) after &$arg. I suppose this isn't an bug, but rather something not implemented or is intensional.