Date: 05/29/00
- Next message: michael <email protected>: "[PHP-DEV] PHP 4.0 Bug #4675: looks like its the same bug as #4485"
- Previous message: thies <email protected>: "Re: [PHP-DEV] Re: [PHP4BETA] array_walk: calling functions taking only ONE paramet && calling methods = not possible?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
From: waldschrott <email protected>
Operating system: All
PHP version: 4.0.0 Release
PHP Bug Type: Feature/Change Request
Bug description: limitations of array_walk() calling methods or single-parameter functions
array_walk() is limited in the way
a) it cannot call methods in classes and
b) itīs not possible to call functions which expect one parameter like htmlspecialchars();
the prior fixing of (a) would enable the user to write a wrapper functions in classes to be able to use single-parameter functions though
Test script:
<?php
$obj=new RX_mail(1);
class RX_mail {
var $examples=array(1=>array('foo <email protected>','"foo" <email protected>', '* <email protected>'),
2=>array('"foobiee" <foo <email protected>>','<subfoo <email protected>>'));
function RX_mail($type) {
$this->array=$this->examples[$type];
// Before returning $this->examples[$type] I wanted to array_walk
// all items to be able to display them
// 1) does not work
array_walk($this->array,'htmlspecialchars');
// 2 does not work, as said
array_walk($this->array,'this->wrapper'); }
function wrapper(&$param1,$param2='') {
return htmlspecialchars($param1); }}
?>
-- 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: michael <email protected>: "[PHP-DEV] PHP 4.0 Bug #4675: looks like its the same bug as #4485"
- Previous message: thies <email protected>: "Re: [PHP-DEV] Re: [PHP4BETA] array_walk: calling functions taking only ONE paramet && calling methods = not possible?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

