Category
Bug: · silent wrong output · found by #36221 program corpus
Problem
$users = [["score" => 98.5], ["score" => 100.0], ["score" => 91.25]];
$sum = 0.0;
foreach ($users as $u) { $sum += $u["score"]; }
echo sprintf("n=%d avg=%.3f", count($users), $sum / count($users)), "\n";
|
output |
| Zend |
n=3 avg=96.583 |
| VM |
n=0 avg=96.583 |
Standalone count($users) and sprintf(..., $n, $avg) with temps are fine — only the double count() in one call-arg list fails.
Repro
test/repro/i36221_sprintf_double_count.php
./script/docker-exec.sh -- bash -lc 'source script/php-env.sh && php test/repro/i36221_sprintf_double_count.php; php bin/vm.php test/repro/i36221_sprintf_double_count.php'
Done when
Parent: #36221
Category
Bug:· silent wrong output · found by #36221 program corpusProblem
n=3 avg=96.583n=0 avg=96.583Standalone
count($users)andsprintf(..., $n, $avg)with temps are fine — only the doublecount()in one call-arg list fails.Repro
test/repro/i36221_sprintf_double_count.php./script/docker-exec.sh -- bash -lc 'source script/php-env.sh && php test/repro/i36221_sprintf_double_count.php; php bin/vm.php test/repro/i36221_sprintf_double_count.php'Done when
test/differential/cases/and green under VMParent: #36221