From:             james_mitchell_au at yahoo dot com dot au
Operating system: Windows
PHP version:      4.3.7
PHP Bug Type:     Unknown/Other Function
Bug description:  Comparing Values (Rare - But not the first time on similair bugs)

Description:
------------
This is as wierd and unique as problems get.

Look at the following line in my code:
if(strcmp($grid[$x-1][$y],'-')==0) {

On the machine I Was building it on, I tried:
if($grid[$x-1][$y] == '-') {

millions of times, and each time it would compare the value '0' with '-'
and return true, I checked that same line of code hundreds of times, till
I finally went to try strcmp and it worked fine

I have had previous problems on another machine a RH Linux one, when
comparing 3's at which time I used trim() but that was using an earlier
version of 4, probably near a year ago. But had not had similair problems
up until now.

I tried this on another machine just now and it worked fine..

I don't have access to the machine the problem was occuring on at this
current time, but I will try to with in the next couple of days and get
the machine specs to better describe them, hopefully get someone to match
them up against and test it.

The test data to use is:
***************
*o*-----*-*---*
*-*****-*-*-*-*
*---------*-*-*
*-****-**-*-*-*
*-*--*-**-*-*-*
*-*--*------*-*
*-*-**-*-**-*-*
*---*--*-**-*o*
***************

Reproduce code:
---------------
http://kicken.mine.nu:8008/extras/bugs/task5.phps

Expected result:
----------------
***************
*o*-----*-*ooo*
*o*****-*-*o*o*
*oooooo---*o*o*
*-****o**-*o*o*
*-*--*o**-*o*o*
*-*--*oooooo*o*
*-*-**-*-**-*o*
*---*--*-**-*o*
***************

With successful run, and nothing on an unsuccessful run


-- 
Edit bug report at http://bugs.php.net/?id=28968&edit=1
-- 
Try a CVS snapshot (php4):  http://bugs.php.net/fix.php?id=28968&r=trysnapshot4
Try a CVS snapshot (php5):  http://bugs.php.net/fix.php?id=28968&r=trysnapshot5
Fixed in CVS:               http://bugs.php.net/fix.php?id=28968&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=28968&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=28968&r=needtrace
Need Reproduce Script:      http://bugs.php.net/fix.php?id=28968&r=needscript
Try newer version:          http://bugs.php.net/fix.php?id=28968&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=28968&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=28968&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=28968&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=28968&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=28968&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=28968&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=28968&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=28968&r=isapi
Install GNU Sed:            http://bugs.php.net/fix.php?id=28968&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=28968&r=float

Reply via email to