src/PhpConsole/EvalProvider.php
protected static function executeCode($_code, array $_sharedVars) {
		foreach($_sharedVars as $var => $value) {
			if(isset($GLOBALS[$var]) && $var[0] == '_') { // extract($this->sharedVars, EXTR_OVERWRITE) and $$var = $value do not overwrites global vars
				$GLOBALS[$var] = $value;
			}
			elseif(!isset($$var)) {
				$$var = $value;
			}
		}

		return eval($_code);
	}
protected static function executeCode($_code, array $_sharedVars) {
		foreach($_sharedVars as $var => $value) {
			if(isset($GLOBALS[$var]) && $var[0] == '_') { // extract($this->sharedVars, EXTR_OVERWRITE) and $$var = $value do not overwrites global vars
				$GLOBALS[$var] = $value;
			}
			elseif(!isset($$var)) {
				$$var = $value;
			}
		}

		return eval($_code);
	}
protected static function executeCode ( $ _code , array $ _sharedVars ) { foreach ( $ _sharedVars as $ var => $ value ) { if ( isset ( $ GLOBALS [ $ var ] ) && $ var [ 0 ] == '_' ) { // extract($this->sharedVars, EXTR_OVERWRITE) and $$var = $value do not overwrites global vars $ GLOBALS [ $ var ] = $ value ; } elseif ( ! isset ( $ $ var ) ) { $ $ var = $ value ; } } return eval ( $ _code ) ; }
Execute code with shared vars
@param $_code
@param array $_sharedVars
@return mixed
Execute code with shared vars