Bug #9195 Updated: Default class function arguments

From: Date: Sun, 06 Jan 2002 18:09:24 +0000
Subject: Bug #9195 Updated: Default class function arguments
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-76074@lists.php.net to get a copy of this message
ID: 9195 Updated by: jan Reported By: nathan@cjhunter.com Old Status: Open Status: Analyzed Bug Type: Feature/Change Request Operating System: Linux PHP Version: 4.0.2 New Comment: please take part in the discussion about the upcoming ZendEngine2 on engine2@lists.zend.com. Previous Comments: ------------------------------------------------------------------------ [2001-02-09 13:00:53] nathan@cjhunter.com 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 this bug report at http://bugs.php.net/?id=9195&edit=1

« previous php.dev (#76074) next »