Location: PHPKode > scripts > PAX > pax/core/classes/InstructionEvaluator.class.php
<?php

/**
 * Page DocBlock definition
 * @package org.zadara.marius.pax
 */

/**
 * Instruction evaluator class definition.
 * 
 * @author Marius Zadara <hide@address.com>
 * @category Classes
 * @copyright (C) 2008-2009 Marius Zadara
 * @license Free for non-comercial use
 * @package org.zadara.marius.pax
 * @final 
 * @see PAXObject
 * @see IInstructionEvaluator
 * @version 6.0
 * @since 6.0
 */
final class InstructionEvaluator extends PAXObject implements IInstructionEvaluator 
{
	/**
	 * Class constructor.
	 *
	 * @access public
	 */
	public function __construct()
	{
		// init the parent
		parent::__construct();
	}
	
	/**
	 * Method to evaluate instruction.
	 * 
	 * @access public
	 * @static 
	 * @param string <b>$instruction</b> The instruction to evaluate
	 * @return mixed The result of the evaluation
	 */
	public static function evaluate($instruction)
	{
		// get the standard evaluation result
		$evalResult = @eval($instruction);
		
		// return the evaluation result
		return (is_null($evalResult) || ($evalResult === false)) ? "" : $evalResult;
	}
	
	/**
	 * Class destructor.
	 *
	 * @access private
	 */
	function __destruct()
	{
	}
}

?>
Return current item: PAX