Bug #67480 [NEW]: String E conversion to numbers.

From: Date: Thu, 19 Jun 2014 15:11:15 +0000
Subject: Bug #67480 [NEW]: String E conversion to numbers.
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-186261@lists.php.net to get a copy of this message
From:             madu dot rapa at gmail dot com
Operating system: ALL
PHP version:      5.4.29
Package:          *General Issues
Bug Type:         Bug
Bug description:String E conversion to numbers.

Description:
------------
<?php
$x='E'; // Assignment of Parameter 
if ( $x!='0') // Check if the value is '0' (string)
{
echo "False";
}
else
{
echo "TRUE";
}
?>

Above code returns False while below code returns TRUE for the if
condition with a warning message --> Notice: Use of undefined constant E
- assumed 'E'

<?php
$x='E'; // Assignment of Parameter 
if ( $x!=0) // Check if the value is 0 (integer)
{
echo "False";
}
else
{
echo "TRUE";
}
?>


-- 
Edit bug report at https://bugs.php.net/bug.php?id=67480&edit=1
-- 



Thread (2 messages)

« previous php.bugs (#186261) next »