Category
bug · php-src-strict · AOT · pillar 4
Problem
cos() matches Zend on VM and JIT, but the AOT-built binary prints 0 (silent wrong output). cosh(0) shows the same zeroed return under AOT.
| Repro |
Zend / VM / JIT (2026-08-02, d9449a349) |
AOT after bin/compile.php |
echo cos(0) |
1 |
0 (exit 0) |
echo cosh(0) |
1 |
0 (exit 0) |
php-src reference
PHP implementation target
ext/standard/cos.php / ext/standard/cosh.php + AOT/JIT float-math lowering — PHP-in-PHP
- Confirm shared float boxing with other AOT math helpers that return
0
Repro
./script/docker-exec.sh -- bash -lc '
cat > /tmp/aot_cos.php <<'"'"'PHP'"'"'
<?php
echo cos(0), "\n";
echo cosh(0), "\n";
PHP
echo -n "zend="; php /tmp/aot_cos.php
echo -n "vm="; php bin/vm.php /tmp/aot_cos.php 2>/dev/null
echo -n "jit="; php bin/jit.php /tmp/aot_cos.php 2>/dev/null | grep -v Deprecated
php bin/compile.php -o /tmp/aot_cos /tmp/aot_cos.php && /tmp/aot_cos
'
Done when
Category
bug· php-src-strict · AOT · pillar 4Problem
cos()matches Zend on VM and JIT, but the AOT-built binary prints0(silent wrong output).cosh(0)shows the same zeroed return under AOT.d9449a349)bin/compile.phpecho cos(0)10(exit 0)echo cosh(0)10(exit 0)php-src reference
ext/standard/math.c—PHP_FUNCTION(cos)/PHP_FUNCTION(cosh)ext/standard/basic_functions.stub.php—cos/coshPHP implementation target
ext/standard/cos.php/ext/standard/cosh.php+ AOT/JIT float-math lowering — PHP-in-PHP0Repro
Done when
1/1matching Zend/VM/JIT--repeat 10on the built binary before claiming fixedtest/repro/guard