(PHP 5 &gt;= 5.0.0)<br/>
Checks if current position is valid
@link http://php.net/manual/en/iterator.valid.php
@return boolean The return value will be casted to boolean and then evaluated.
Returns true on success or false on failure.
975841
public function valid()
    {
        if($this->folderList == null){
            $this->folderList = $this->listFolder();
        }
        return is_array($this->folderList) && isset($this->folderList[$this->key]);
    }
1283493
public function valid()
    {
        if (is_null($this->current)) {
            return ! empty($this->branch);
        }
        if ($this->current instanceof RecursiveLeafInterface) {
            return $this->current->valid();
        }

        return false;
    }
870566
private function validateInput()
    {
        $returnValue = (bool) false;

        
        
        $returnValue = true;
        
        /**
         * Parse the arguments from the command lines 
         * and set them into the parameter variable.
         * All the current formats are allowed:
         * <code>
         * php script.php -arg1 value1 -arg2 value2
         * php script.php --arg1 value1 --arg2 value2
         * php script.php -arg1=value1 -arg2=value2
         * php script.php --arg1=value1 --arg2=value2
         * php script.php value1 value2 //the key will be numeric
         * </code>
         */
        $i = 1;
        while($i < count($this->argv)){
        	$arg = trim($this->argv[$i]);
        	if(!empty($arg)){
        	    // command -(-)arg1=value1
        		if(preg_match("/^[\-]{1,2}\w+=(.*)+$/", $arg)){
        		    $sequence = explode('=', preg_replace("/^[\-]{1,}/", '', $arg));
	        		if(count($sequence) >= 2){
	        			$this->parameters[$sequence[0]] = $sequence[1];
	        		}
	        	}
	        	// command -(-)arg1 value1 value2
        		else if(preg_match("/^[\-]{1,2}\w+$/", $arg)){
        		    $key = preg_replace("/^[\-]{1,}/", '', $arg);
    			    $this->parameters[$key] = '';
    			    while(isset($this->argv[$i + 1]) && substr(trim($this->argv[$i + 1]),0,1)!='-') {
    			        $this->parameters[$key] .= trim($this->argv[++$i]).' ';
    			    }
    			    $this->parameters[$key] = substr($this->parameters[$key], 0, -1); 
	        	}
        	    // command value1 value2
	        	else{
	        		$this->parameters[$i] = $arg;
	        	}
        	}
        	$i++;
        }

        //replaces shortcuts by their original names
        if (isset($this->inputFormat['parameters'])) {
            foreach($this->inputFormat['parameters'] as $parameter){
            	if(isset($parameter['shortcut'])){
            		$short = $parameter['shortcut'];
            		$long = $parameter['name'];
            		if(array_key_exists($short, $this->parameters) && !array_key_exists($long, $this->parameters)){
    					$this->parameters[$long] = $this->parameters[$short];
    					unset($this->parameters[$short]);
    				}
            	}
            }
        }
        
        //one we have the parameters, we can validate it
        if(isset($this->inputFormat['min'])){
        	$min 	= (int) $this->inputFormat['min'];
        	$found 	=  count($this->parameters);
        	if($found < $min){
        		$this->err("Invalid parameter count: $found parameters found ($min expected)");
        		$returnValue = false;
        	}
        }
        
        if(isset($this->inputFormat['required']) && is_array($this->inputFormat['required']) && count($this->inputFormat['required'])){
        	
			$requireds = array();
			if(!is_array($this->inputFormat['required'][0])){
        		$requireds = array($this->inputFormat['required']);
        	}else{
        		$requireds = $this->inputFormat['required'];
        	}
        	
        	$found = false;
        	foreach($requireds as $required){
        		
        		$matched = 0;
	        	foreach($required as $parameter){
	        		if(array_key_exists($parameter, $this->parameters)){
	        			$matched++;
	        		}
	        	}
	        	if($matched == count($required)){
        			$found = true;
        			break;
	        	}
        	}
        	
        	if(!$found){
        		$this->err("Unable to find required arguments");
        		$returnValue = false;
        	}
        }
        
        if($returnValue && isset($this->inputFormat['parameters'])){
        	 foreach($this->inputFormat['parameters'] as $parameter){
        		if(isset($this->parameters[$parameter['name']])){
	        	 	$input = $this->parameters[$parameter['name']];
		        	switch($parameter['type']){
		        		case 'file': 
		       				if( !is_file($input) || 
		       					!file_exists($input) || 
		       					!is_readable($input))
		       				{
		       					$this->err("Unable to access to the file: $input");
		       					$returnValue = false;
		       				}
		       				break;
	        			case 'dir': 
	        				if( !is_dir($input) || 
	        					!is_readable($input))
	        				{
	        					$this->err("Unable to access to the directory: $input");
	        					$returnValue = false;
	        				}
	        				break;
	        			case 'path': 
	        				if( !is_dir(dirname($input)) )
	        				{
	        					$this->err("Wrong path given: $input");
	        					$returnValue = false;
	        				}
	        				break;
	        			case 'int':
	        			case 'float':
	        			case 'double':
	        				if(!is_numeric($input)){
	        					$this->err("$input is not a valid ".$parameter['type']);
	        					$returnValue = false;
	        				}
	        				break;
	        			case 'string':
	        				if(!is_string($input)){
	        					$this->err("$input is not a valid ".$parameter['type']);
	        					$returnValue = false;
	        				}
	        				break;
	        			case 'boolean':
	        				if(!is_bool($input) && strtolower($input) != 'true' && strtolower($input) != 'false' && !empty($input)){
	        					$this->err("$input is not a valid ".$parameter['type']);
	        					$returnValue = false;
	        				}else{
	        					if(is_bool($input)){
	        						$this->parameters[$parameter['name']] = $input = settype($input, 'boolean');
	        					}
	        					else if(!empty($input)){
	        						$this->parameters[$parameter['name']] = ((strtolower($input) == 'true') ? true : false);
	        					}
	        					else{
	        						$this->parameters[$parameter['name']] = true;
	        					}
	        				}
	        				break;
	        				
	        		}
        		}
        	}
        }
        
 
        
        

        return (bool) $returnValue;
    }
319937
public function valid()
    {

        if ($this->container['typeId'] === null) {
            return false;
        }
        if ($this->container['quantity'] === null) {
            return false;
        }
        if ($this->container['locationId'] === null) {
            return false;
        }
        if ($this->container['locationType'] === null) {
            return false;
        }
        $allowedValues = $this->getLocationTypeAllowableValues();
        if (!in_array($this->container['locationType'], $allowedValues)) {
            return false;
        }
        if ($this->container['itemId'] === null) {
            return false;
        }
        if ($this->container['locationFlag'] === null) {
            return false;
        }
        $allowedValues = $this->getLocationFlagAllowableValues();
        if (!in_array($this->container['locationFlag'], $allowedValues)) {
            return false;
        }
        if ($this->container['isSingleton'] === null) {
            return false;
        }
        return true;
    }
1203061
public function valid()
    {
        if (!isset($this->resources[$this->position])) {
            $this->fetchBatch();
        }

        return isset($this->resources[$this->position]);
    }
1019249
public function valid()
    {
        if (!isset($this->_results[$this->key()])) {
            return false;
        }

        $this->_current = $this->_results[$this->key()];

        return true;
    }
1010801
public function valid()
    {
        if ($this->getItemPosition() >= $this->getItemOffset()
            && $this->getItemPosition() < ($this->getItemOffset() + $this->getItemCount())
        ) {
            return parent::valid();
        }
        return false;
    }
49155
public function valid()
    {
        if ($this->_countParts === null) {
            $this->countParts();
        }
        return $this->_iterationPos && $this->_iterationPos <= $this->_countParts;
    }
83864
public function isValid() {

		if(!isset($this->valid)) {
            $this->valid = $this->applyValidators(
                $this->applyModifiers($this->getValue())
            );
		}

		return $this->valid;

	}
46868
public function valid()
    {

        if ($this->container['name'] === null) {
            return false;
        }
        if (strlen($this->container['name']) > 40) {
            return false;
        }
        if (strlen($this->container['name']) < 1) {
            return false;
        }
        $allowedValues = $this->getColorAllowableValues();
        if (!in_array($this->container['color'], $allowedValues)) {
            return false;
        }
        return true;
    }
1052472
public function valid() : bool
    {
        if ($this->pointer >= 0 && $this->pointer < $this->collection->length()) {
            return true;
        } else {
            return false;
        }
    }
253621
public function valid()
    {
        if (!$this->splFileObject->valid()) {
            return false;
        }

        if ($this->splFileObject->key() === 0) {
            $this->splFileObject->next();
        }

        $current = $this->splFileObject->current();

        return $current <> [null];
    }
998779
public function valid()
    {
        if ($this->_index == count($this->_items) && $this->_batchIndex < count($this->_ids)) {
            $this->_getNextPage();
        }

        if ($this->_index < count($this->_items)) {
            return true;
        } else {
            return false;
        }
    }
1215974
public function valid()
    {
        if (!isset($this->keys[$this->position])) {
            return false;
        }

        $currentKey = $this->keys[$this->position];

        return isset($this->items[$currentKey]);
    }
770801
public function valid() : bool
    {
        if (false === $this->result->fetch(\PDO::FETCH_ASSOC, \PDO::FETCH_ORI_ABS, $this->pointer)) {
            return false;
        }
        return true;
    }
435976
public function valid()
    {
        if ($this->fileSize == 0) {
            return false;
        }

        if (feof($this->handle)) {
            return false;
        }

        $current = fgets($this->handle);

        if (trim($current) === '' && feof($this->handle)) {
            return false;
        } else {
            fseek($this->handle, $this->offset);
        }

        return true;
    }
501088
public function valid()
    {
        $map = $this->__getSerialisablePropertyMap();
        $mapKeys = array_keys($map);
        return isset($mapKeys[$this->iteratorPosition]);
    }