こんにちは、私はphpsフィルタクラスを使いこなしてきました。そして、filter_callbackフィルタで不具合を見つけました。OOPクラスのPHP FILTER_CALLBACK
コードの動作の以下の荒いビットが、エラーごとに示し
警告:にfilter_var()[function.filter-VAR]:最初に引数が中/ユーザ/ロブ有効なコールバックとして期待されていますライン上の/sites/test_val.php 12
class test
{
public function callback($string)
{
$var = filter_var($string, FILTER_CALLBACK, array('options' => $this->foo($string)));
}
public function foo($string){
echo $string;
}
}
$test = new test();
$string = 'test';
$tested = $test->callback($string);
は私が正しく関数を呼び出すか、別の方法があるのですか?
array($this, 'foo')
コールバックなどの方法を使用する場合
*(参照)* [コールバック偽](http://php.net/manual/en/language.pseudo-types.php#language.types .callback) – Gordon
[オブジェクトメソッドをコールバック関数として使用する方法]の複製可能性(http://stackoverflow.com/questions/3350762/how-to-use-an-object-method-as-a-callback-関数) – Gordon