Mantis - Quercus
|
|||||
Viewing Issue Advanced Details | |||||
|
|||||
ID: | Category: | Severity: | Reproducibility: | Date Submitted: | Last Update: |
4059 | block | always | 06-01-10 09:13 | 06-08-10 08:26 | |
|
|||||
Reporter: | sblommers | Platform: | Linux | ||
Assigned To: | OS: | Ubuntu | |||
Priority: | normal | OS Version: | 10.04 | ||
Status: | new | Product Version: | 4.0.8 | ||
Product Build: | SVN | Resolution: | open | ||
Projection: | none | ||||
ETA: | none | Fixed in Version: | |||
|
|||||
Summary: | 0004059: PHP Type comparison not the same | ||||
Description: |
Differences in type comparison between Quercus and PHP that are possibly causing most incompatibilities in existing PHP applications running on Quercus. Some of the type checks that are different on Quercus are causing major inconsistencies in data (I filed some bugs for Drupal). |
||||
Steps To Reproduce: |
Run this script on both PHP and Quercus and see the difference (or download from https://streamconsulting.nl/drop/php-type-comparison.php) [^] <?php $tests = array(); /* Testing equalty */ $tests['=='] = create_function('$a, $b', 'return $a==$b;'); $tests['!='] = create_function('$a, $b', 'return $a!=$b;'); $tests['<>'] = create_function('$a, $b', 'return $a<>$b;'); $tests['<'] = create_function('$a, $b', 'return $a<$b;'); $tests['>'] = create_function('$a, $b', 'return $a>$b;'); $tests['<='] = create_function('$a, $b', 'return $a<=$b;'); $tests['>='] = create_function('$a, $b', 'return $a>=$b;'); /* Testing identity */ $tests['==='] = create_function('$a, $b', 'return $a===$b;'); $tests['!=='] = create_function('$a, $b', 'return $a!==$b;'); $comparison = array(); $comparison['TRUE'] = true; $comparison['FALSE'] = false; $comparison['1'] = 1; $comparison['0'] = 0; $comparison['-1'] = -1; $comparison['3,14'] = pi(); $comparison['"1"'] = '1'; $comparison['"0"'] = '0'; $comparison['"-1"'] = '-1'; $comparison['NULL'] = null; $comparison['array()'] = array(); $comparison['"php"'] = 'php'; print '<h1>PHP version '.PHP_VERSION.' type comparison tables</h1>'; foreach ($tests as $test=>$function) { print "<h2>Comparisons with $test</h2>"; print "<table border='1'>"; print "<tr>"; print "<th> </th>"; foreach (array_keys($comparison) as $name) { print "<th>$name</th>"; } print "</tr>"; foreach ($comparison as $arg_1_name => $arg_1_value) { print '<tr>'; print "<th>$arg_1_name</th>"; foreach ($comparison as $arg_2_value) { print '<td>'; print $function($arg_1_value, $arg_2_value)==true ? '<span style="color:00F;">TRUE</span>' : '<span style="color:#F00;">FALSE</span>'; print '</td>'; } print "</tr>"; } print "</table>"; } ?> |
||||
Additional Information: | |||||
Relationships | |||||
Attached Files: |
Notes | |||||
|
|||||
|
|