PHP 4.0 Bug #9195: Default class function arguments
| From: | nathan at cjhunter dot com | Date: | Fri, 09 Feb 2001 18:00:54 +0000 |
| Subject: | PHP 4.0 Bug #9195: Default class function arguments | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-46098@lists.php.net to get a copy of this message | ||
From: nathan@cjhunter.com
Operating system: Linux
PHP version: 4.0.2
PHP Bug Type: Feature/Change Request
Bug description: Default class function arguments
I'm requesting that the default function arguments for a class method be able to reference the
class variable members in it's definition.
Here is an example of it's use:
class searchclass {
var $hits;
var $results;
function save($filename, $start = 0, $end = $this->hits){ /* <- this returns Parse error: */
if($fp = @fopen($filename, "w")){
for($i = $start; $i < $end; $i++){
fwrite($fp, implode("|", $this->results[$i]));
}
}else{
return false;
}
}
function search(){
/* ... */
}
}
--
Edit Bug report at: http://bugs.php.net/?id=9195&edit=1