function token($str) {
		$str=preg_replace_callback(
			'/(?<!\w)@(\w(?:[\w\.\[\]])*)/',
			function($token) {
				// Convert from JS dot notation to PHP array notation
				return '$'.preg_replace_callback(
					'/(\.\w+)|\[((?:[^\[\]]*|(?R))*)\]/',
					function($expr) {
						$fw=\Base::instance();
						return
							'['.
							($expr[1]?
								$fw->stringify(substr($expr[1],1)):
								(preg_match('/^\w+/',
									$mix=$this->token($expr[2]))?
									$fw->stringify($mix):
									$mix)).
							']';
					},
					$token[1]
				);
			},
			$str
		);
		return trim($str);
	}
function token($str) {
		$str=preg_replace_callback(
			'/(?<!\w)@(\w(?:[\w\.\[\]])*)/',
			function($token) {
				// Convert from JS dot notation to PHP array notation
				return '$'.preg_replace_callback(
					'/(\.\w+)|\[((?:[^\[\]]*|(?R))*)\]/',
					function($expr) {
						$fw=\Base::instance();
						return
							'['.
							($expr[1]?
								$fw->stringify(substr($expr[1],1)):
								(preg_match('/^\w+/',
									$mix=$this->token($expr[2]))?
									$fw->stringify($mix):
									$mix)).
							']';
					},
					$token[1]
				);
			},
			$str
		);
		return trim($str);
	}
function token ( $ str ) { $ str = preg_replace_callback ( '/(?<!\w)@(\w(?:[\w\.\[\]])*)/' , function ( $ token ) { // Convert from JS dot notation to PHP array notation return '$' . preg_replace_callback ( '/(\.\w+)|\[((?:[^\[\]]*|(?R))*)\]/' , function ( $ expr ) { $ fw = \ Base :: instance ( ) ; return '[' . ( $ expr [ 1 ] ? $ fw -> stringify ( substr ( $ expr [ 1 ] , 1 ) ) : ( preg_match ( '/^\w+/' , $ mix = $ this -> token ( $ expr [ 2 ] ) ) ? $ fw -> stringify ( $ mix ) : $ mix ) ) . ']' ; } , $ token [ 1 ] ) ; } , $ str ) ; return trim ( $ str ) ; }
Convert tokens in string expression to variable names
@return string
@param $str string
Convert tokens in string expression to variable names