Heroes for help, PHP error, online, etc...

Source: Internet
Author: User
Tags parse error php error
Each PHP

Error message

Warning:call-time pass-by-reference has been deprecated; If you would a-pass it by reference, modify the declaration of each (). If you would as to enable Call-time pass-by-reference, you can set Allow_call_time_pass_reference to true in your INI fi Le in D:\APMServ5.2.6\www\htdocs\base\admin\config.php on line 23

Parse error:syntax error, unexpected ' [' D:\APMServ5.2.6\www\htdocs\base\admin\config.php on line 23

Error Location Code
if ($step = = "Modify") {    $var = $_post[' var '];    Do    {        $val = each (& $var) [1];//error        $key = each (& $var) [0];//error        if (each (& $var))        {            $msql->query ("Update {P}_base_config set value= ' {$val} ' where variable= ' {$key} '");        }    } while (1);    Sayok ($strConfigOk, "config.php", "");}


Reply to discussion (solution)

Why do you write it like this?
$val = each (& $var) [1];
$key = each (& $var) [0];
Isn't that okay?
$val = each ($var) [1];
$key = each ($var) [0];

Writing like this is not better?
List ($key, $val) = each ($var);

Why do you write it like this?
$val = each (& $var) [1];
$key = each (& $var) [0];
Isn't that okay?
$val = each ($var) [1];
$key = each ($var) [0];

Writing like this is not better?
List ($key, $val) = each ($var); So the environment is jammed.

There's no reason!
You can't just change it because you have a problem with your program.

The reason for each (& $var) error is that you can't pass a reference like this, which is a convention with PHP 5.3
each ($var) [0] is written in PHP 5.3.

If you're stuck with the grammar rules of PHP 5.3, you're going to have to figure out where your problem is.

There's no reason!
You can't just change it because you have a problem with your program.

The reason for each (& $var) error is that you can't pass a reference like this, which is a convention with PHP 5.3
each ($var) [0] is written in PHP 5.3.

If you are stuck with the grammar rules of PHP 5.3, then you have to think about where your problem is. Oh, my production environment is php5.2.6, this follows the list ($key, $val) = each ($var);

does while (1) infinite loop does not exit the statement, why does not card?

Then you print_r ($_post[' var '); Post the results

does while (1) infinite loop does not exit the statement, why does not card? Hero help, just getting started how to quit

if (each (& $var))
{
$msql->query ("Update {P}_base_config set value= ' {$val} ' where variable= ' {$key} '");
Break
}
So we can quit.

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.