#33616 [Opn->Bgs]: The Answer to Life, the Universe and Everything = 41?

From: Date: Fri, 08 Jul 2005 13:37:23 +0000
Subject: #33616 [Opn->Bgs]: The Answer to Life, the Universe and Everything = 41?
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-81588@lists.php.net to get a copy of this message
ID: 33616 Updated by: derick@php.net Reported By: panos at com2go dot com -Status: Open +Status: Bogus Bug Type: *Math Functions Operating System: Linux PHP Version: 4.3.11 New Comment: Sorry, but your problem does not imply a bug in PHP itself. For a list of more appropriate places to ask for help using PHP, please visit http://www.php.net/support.php as this bug system is not the appropriate forum for asking support questions. Due to the volume of reports we can not explain in detail here why your report is not a bug. The support channels will be able to provide an explanation for you. Thank you for your interest in PHP. . Previous Comments: ------------------------------------------------------------------------ [2005-07-08 15:35:26] panos at com2go dot com Description: ------------ While to trying to make a simple one line script that will display the answer to life, the universe, and everything I noticed that the answer comes up wrong if the equiation is concatenated with text. The text is not displayed instead 1 is subtracted from any mathimatical equation that is concatenated with any text. It seems that PHP is not differentiating between text and integer and assigning the text a value of -1. You may consider this a 'feature' as text is assigned a value of -1 or FALSE and . is percived as +. However for that to be true "echo 1 . 1" should return "2" not "11" Reproduce code: --------------- print "What do you get if you multiply SIX by NINE: ". 1 + 5 * 8 + 1; Expected result: ---------------- What do you get if you multiply SIX be NINE: 42 Actual result: -------------- 41 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=33616&edit=1

« previous php.bugs (#81588) next »