2

I have a function right here:

function loginForm($post){
    $username = c($post['username']);
    $password = md5(c($post['password']));
    if($this->login($username,$password))
        $this->setCookies($post);
}

As you can see the username and password are returned from a function called c() (which is just $mysqli->real_escape_string()).

Now, as you can see in the password field, there are 2 functions.

$password = md5(c($post['password']));

My question is, will the c() function run first, or the md5 function will run first? I'm almost sure the c() function is running first, but I'm not sure.

4

5 に答える 5

6

c runs first.

Because you can rewrite it to:

$temp = c($post['password']);
$password = md5($temp);

You can not rewrite it so that md5 is called first.

于 2013-06-11T16:48:06.137 に答える
4

The c function will run first.

于 2013-06-11T16:48:07.607 に答える
3
$password = md5(c($post['password']));

と同等です

$password_c = c($post['password']);
$password = md5($password_c);

c最初に実行されます。

于 2013-06-11T16:48:39.530 に答える
1

c()が最初に実行され、次にmd5().

于 2013-06-11T16:49:15.103 に答える