<?php

namespace Predis\Options;

class CustomOption extends Option {
    private $_validate, $_default;

    public function __construct(Array $options) {
        $validate = isset($options['validate']) ? $options['validate'] : 'parent::validate';
        $default  = isset($options['default']) ? $options['default'] : 'parent::getDefault';
        if (!is_callable($validate) || !is_callable($default)) {
            throw new \InvalidArgumentException("Validate and default must be callable");
        }
        $this->_validate = $validate;
        $this->_default  = $default;
    }

    public function validate($value) {
        return call_user_func($this->_validate, $value);
    }

    public function getDefault() {
        return $this->validate(call_user_func($this->_default));
    }
}

<?php

namespace Predis\Options;

class CustomOption extends Option {
    private $__validate, $_default;

    public function __construct(Array $options) {
        $validate = isset($options['validate']) ? $options['validate'] : 'parent::validate';
        $default  = isset($options['default']) ? $options['default'] : 'parent::getDefault';
        if (!is_callable($validate) || !is_callable($default)) {
            throw new \InvalidArgumentException("Validate and default must be callable");
        }
        $this->_validate = $validate;
        $this->_default  = $default;
    }

    public function validate($value) {
        return call_user_func($this->_validate, $value);
    }

    public function getDefault() {
        return $this->validate(call_user_func($this->_default));
    }
}

--- 
+++ 
@@ -3,7 +3,7 @@
 namespace Predis\Options;
 
 class CustomOption extends Option {
-    private $__validate, $_default;
+    private $_validate, $_default;
 
     public function __construct(Array $options) {
         $validate = isset($options['validate']) ? $options['validate'] : 'parent::validate';
Fix wrong name for private field.
