Mantis Bugtracker
  

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0002251 [Quercus] major always 12-13-07 12:15 12-17-07 09:38
Reporter koreth View Status public  
Assigned To ferg
Priority normal Resolution fixed  
Status closed   Product Version 3.1.4
Summary 0002251: Bit operators do not do implicit string to integer conversion
Description <?php
$val = "15";
print ($val & 1) . "\n";

Vanilla PHP prints "1". Quercus prints "0".
Additional Information
Attached Files

- Relationships

- Notes
(0002569)
koreth
12-13-07 12:34

Patch:

--- a/modules/quercus/src/com/caucho/quercus/env/StringValue.java
+++ b/modules/quercus/src/com/caucho/quercus/env/StringValue.java
@@ -674,7 +674,7 @@ abstract public class StringValue extends Value implements C
       return sb;
     }
     else
- return LongValue.ZERO;
+ return super.bitAnd(rValue);
   }
   
   /*
@@ -704,7 +704,7 @@ abstract public class StringValue extends Value implements C
       return sb;
     }
     else
- return rValue;
+ return super.bitOr(rValue);
   }
   
   /*
@@ -729,7 +729,7 @@ abstract public class StringValue extends Value implements C
       return sb;
     }
     else
- return rValue;
+ return super.bitXor(rValue);
   }
   
   /**
 
(0002580)
ferg
12-17-07 09:38

php/0379, php/0388, php/0398
 

- Issue History
Date Modified Username Field Change
12-13-07 12:15 koreth New Issue
12-13-07 12:34 koreth Note Added: 0002569
12-17-07 09:38 ferg Note Added: 0002580
12-17-07 09:38 ferg Assigned To  => ferg
12-17-07 09:38 ferg Status new => closed
12-17-07 09:38 ferg Resolution open => fixed
12-17-07 09:38 ferg Fixed in Version  => 3.1.5


Mantis 1.0.0rc3[^]
Copyright © 2000 - 2005 Mantis Group
31 total queries executed.
27 unique queries executed.
Powered by Mantis Bugtracker