解析错误:语法错误,意外'while'(T_WHILE)

0 php syntax parsing do-while

我无法修复此错误:

Parse error: syntax error, unexpected 'while' (T_WHILE) in /xyz/xyz.php on line 76
Run Code Online (Sandbox Code Playgroud)

我正在使用php 5.4.4

有人可以帮忙吗?

xyz.php 74-96行:

if (( function_exists( 'get_magic_quotes_gpc' ) &&    get_magic_quotes_gpc(  ) )) {
    $process = array( &$_GET, &$_POST, &$_COOKIE, &$_REQUEST );
    $val = while (list($key, $val) = each($process)) {;
        [0];
        $key = ;

        if () {
            foreach ($val as $k => $v) {
                unset( $process[$key][$k] );

                if (is_array( $v )) {
                    $process[$key][stripslashes( $k )] = $v;
                    $process[] = &$process[$key][stripslashes( $k )];

                    continue;
                }

                $process[$key][stripslashes( $k )] = stripslashes( $v );
            }
        }

        unset( $$process );
    }
Run Code Online (Sandbox Code Playgroud)

Mar*_*c B 7

while 是一种语言结构,并不是你可以从中获取返回值的东西:

$val = while ( ... ) { ... }
^^^^^^---invalid
Run Code Online (Sandbox Code Playgroud)

它应该是公正的

while (...) { ... }
Run Code Online (Sandbox Code Playgroud)

  • +1,但糟糕的`while`只是代码中的众多问题之一...... (2认同)