ThinkPHP/Library/Vendor/TemplateLite/internal/compile.compile_if.php

(开头部分) 3KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

<?php
/**
 * Template Lite compile IF tag - template internal module
 *
 * Type:	 template
 * Name:	 compile_parse_is_expr
 */

function compile_compile_if($arguments, $elseif, $while, &$object)
{
	$_result	= "";
	$_match		= array();
	$_args		= array();
	$_is_arg_stack	= array();

	// extract arguments from the equation
	preg_match_all('/(?>(' . $object->_var_regexp . '|\/?' . $object->_svar_regexp . '|\/?' . $object->_func_regexp . ')(?:' . $object->_mod_regexp . '*)?|\-?0[xX][0-9a-fA-F]+|\-?\d+(?:\.\d+)?|\.\d+|!==|===|==|!=|<>|<<|>>|<=|>=|\&\&|\|\||\(|\)|,|\!|\^|=|\&|\~|<|>|\%|\+|\-|\/|\*|\@|\b\w+\b|\S+)/x', $arguments, $_match);
	$_args = $_match[0];

	// make sure we have balanced parenthesis
	$_args_count = array_count_values($_args);
	if(isset($_args_count['(']) && $_args_count['('] != $_args_count[')'])
	{
		$object->trigger_error("unbalanced parenthesis in if statement", E_USER_ERROR, __FILE__, __LINE__);
	}

	$count_args = count($_args);
	for ($i = 0, $for_max = $count_args; $i < $for_max; $i++)
	{
		$_arg = &$_args[$i];
		switch (strtolower($_arg))
		{
			case '!':
			case '%':
			case '!==':
			case '==':
			case '===':
			case '>':
			case '<':
			case '!=':
			case '<>':
			case '<<':
			case '>>':
			case '<=':
			case '>=':
			case '&&':
			case '||':
			case '^':
			case '&':
			case '~':
			case ')':
			case ',':
			case '+':
			case '-':
			case '*':
			case '/':
			case '@':
				break;
			case 'eq':
				$_arg = '==';
后面还有 94 行代码,购买后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。