Date: 08/17/01
- Next message: fearuk <email protected>: "[PHP-DEV] Bug #12810: 3"
- Previous message: icom <email protected>: "[PHP-DEV] Bug #12754: HTTP "PUT" Command in PHP4"
- Next in thread: derick <email protected>: "[PHP-DEV] Bug #12809 Updated: function calls, default arguments and passing references"
- Reply: derick <email protected>: "[PHP-DEV] Bug #12809 Updated: function calls, default arguments and passing references"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
From: anders <email protected>
Operating system: linux 2.2
PHP version: 4.0.4pl1
PHP Bug Type: Feature/Change Request
Bug description: function calls, default arguments and passing references
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.
-- Edit bug report at: http://bugs.php.net/?id=12809&edit=1-- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: php-dev-unsubscribe <email protected> For additional commands, e-mail: php-dev-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>
- Next message: fearuk <email protected>: "[PHP-DEV] Bug #12810: 3"
- Previous message: icom <email protected>: "[PHP-DEV] Bug #12754: HTTP "PUT" Command in PHP4"
- Next in thread: derick <email protected>: "[PHP-DEV] Bug #12809 Updated: function calls, default arguments and passing references"
- Reply: derick <email protected>: "[PHP-DEV] Bug #12809 Updated: function calls, default arguments and passing references"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

