PHP comparion doesnt work..why?
Posted
by user248959
on Stack Overflow
See other posts from Stack Overflow
or by user248959
Published on 2010-04-08T18:21:50Z
Indexed on
2010/04/08
18:23 UTC
Read the original article
Hit count: 421
php
|comparison
Hi,
i have this code:
$password_introducido = sfContext::getInstance()->getUser()->getGuardUser()->setPassword($value['password_actual']);
$password_almacenado = sfContext::getInstance()->getUser()->getGuardUser()->getPassword();
var_dump("kfjsdlkjf");
var_dump($password_almacenado);
var_dump($password_almacenado);
if($password_introducido == $password_almacenado){
die("entrosopi");
}
that prints this:
string 'kfjsdlkjf' (length=9)
string 'c9c40d11b29ac0f5bdef3be51ce61187582c3ae1' (length=40)
string 'c9c40d11b29ac0f5bdef3be51ce61187582c3ae1' (length=40)
IMHO, it should print "entrosopi", but it doesnt. Why?
If i instead write
if(!$password_introducido == $password_almacenado)
it prints "entrosopi".
Javi
© Stack Overflow or respective owner