Category
bug · php-src-strict · AOT · pillar 4
Problem
filesize() on a two-byte file matches Zend on VM and JIT (2), but the AOT binary returns a wrong size (35 observed on 712a1e64a).
| Repro |
Zend / VM / JIT (2026-08-02, 712a1e64a) |
AOT bin/compile.php |
file_put_contents(... ,"hi"); filesize(...) |
2 |
builds; run prints 35 (not 2) |
Silent wrong output — characteristic failure mode; compliance recorded expectations would miss this vs Zend.
php-src reference
PHP implementation target
ext/standard filestat path + AOT/JIT lowering in lib/JIT — PHP-in-PHP
- Likely wrong path / cwd / return boxing under thin standalone; fix in PHP lowering, not new C
Repro
./script/docker-exec.sh -- bash -lc '
cat > /tmp/aot_filesize.php <<'"'"'PHP'"'"'
<?php
$path = "/tmp/aot_filesize_probe.txt";
file_put_contents($path, "hi");
echo filesize($path), "\n";
PHP
echo -n "zend="; php /tmp/aot_filesize.php
echo -n "vm="; php bin/vm.php /tmp/aot_filesize.php 2>/dev/null
echo -n "jit="; php bin/jit.php /tmp/aot_filesize.php 2>/dev/null | grep -v Deprecated
php bin/compile.php -o /tmp/aot_filesize /tmp/aot_filesize.php && /tmp/aot_filesize
'
Done when
Category
bug· php-src-strict · AOT · pillar 4Problem
filesize()on a two-byte file matches Zend on VM and JIT (2), but the AOT binary returns a wrong size (35observed on712a1e64a).712a1e64a)bin/compile.phpfile_put_contents(... ,"hi"); filesize(...)235(not2)Silent wrong output — characteristic failure mode; compliance recorded expectations would miss this vs Zend.
php-src reference
ext/standard/filestat.c—PHP_FUNCTION(filesize)/php_statext/standard/basic_functions.stub.php—filesizePHP implementation target
ext/standardfilestat path + AOT/JIT lowering inlib/JIT— PHP-in-PHPRepro
Done when
2matching Zend/VM/JIT--repeat 10on the built binary before claiming fixedtest/repro/guard