Bug #10734 Updated: Strange conversion string->numbers

From: Date: Thu, 10 May 2001 12:58:28 +0000
Subject: Bug #10734 Updated: Strange conversion string->numbers
Groups: php.dev 
Request: Send a blank email to php-dev+get-54683@lists.php.net to get a copy of this message
ID: 10734 Updated by: zeev Reported By: konrad@interdata.net.pl Old-Status: Open Status: Closed Bug Type: *General Issues Operating system: PHP Version: 4.0.5 Assigned To: Comments: Fixed in the CVS. Thanks for the report! Previous Comments: --------------------------------------------------------------------------- [2001-05-08 11:44:43] hholzgra@php.net AFAIR this is some strange magic borrowed from perl the deeper sense in this is that you can use it to increment/decrement the numerical part of serial numbers and such IMHO this is more confusing then helpfull and should be nuked --------------------------------------------------------------------------- [2001-05-08 11:26:43] konrad@interdata.net.pl Here is a simple code <? header("content-type: text/plain"); $num = -5; echo "$numn"; $num++; echo "$numn"; $num--; echo "$numn"; echo "----------n"; $num = "-5"; echo "$numn"; $num++; echo "$numn"; $num--; echo "$numn"; ?> And here results -5 -4 -5 ---------- -5 -6 <-- ????????????????? -7 It looks like "++" operator do not work properly on variables enclosed in double-quotes. Other operators (ie $num = $num +1) woks properly. --------------------------------------------------------------------------- ATTENTION! Do NOT reply to this email! To reply, use the web interface found at http://bugs.php.net/?id=10734&edit=2

« previous php.dev (#54683) next »