Bug #16898: type convertation problem in pow()
| From: | sasha at xxi dot co dot il | Date: | Mon, 29 Apr 2002 10:17:24 +0000 |
| Subject: | Bug #16898: type convertation problem in pow() | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-6435@lists.php.net to get a copy of this message | ||
From: sasha@xxi.co.il
Operating system: Linux
PHP version: 4.2.0
PHP Bug Type: *Math Functions
Bug description: type convertation problem in pow()
$result=mysql_query("SELECT id, cdate FROM newspaper WHERE
path='".substr($a, strrpos($a, "/")+1, strlen($a))."'") or die
(mysql_error());
$rec=mysql_fetch_array($result);
$e=pow(2, $rec[id]); //Warning!
it's looks like what pow() function can't convert $rec[id] variable from
string to integer automatically.
Using
$rec[id]=stettype($rec[id], "int");
helps
--
Edit bug report at http://bugs.php.net/?id=16898&edit=1
--
Fixed in CVS: http://bugs.php.net/fix.php?id=16898&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=16898&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=16898&r=needtrace
Try newer version: http://bugs.php.net/fix.php?id=16898&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=16898&r=support
Expected behavior: http://bugs.php.net/fix.php?id=16898&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=16898&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=16898&r=submittedtwice