PHPのコールバックは少し使い辛いので、それを和らげるようなスニペットを実験的に書いた。 コードはこんな感じ。 <?php class Curry { protected $callback, $bind; protected function __construct($callback, Array $bind) { if(!is_callable($callback)) throw new InvalidArgumentException; list($this->callback, $this->bind) = func_get_args(); } static function make($callback, $bind) { return array(new self($callback, $bind), 'invoke'); } function invoke() { $arg