mirror of
https://github.com/php/php-src.git
synced 2026-04-05 07:02:33 +02:00
Test case "ext/standard/tests/array/range.phpt" failed on ARM64 machine only under RELEASE mode. How to reproduce it: ``` ./buildconf -f; ./configure; make -j 128 make test TESTS="-d opcache.enable=1 -d opcache.enable_cli=1 ext/standard/tests/array/range.phpt" ``` Root cause: I suspect the root cause is that on ARM64 machine, PHP RELEASE mode produces different values for internal function range() compared to DEBUG mode. Take the downsized test case downsize-range.php [1] as an example. We applied the check-element.diff patch to check the original values. Note that we print out the floating point numbers with precision 16. From the outputs in file output.md, we can see the 7-th and 9-th elements are different between RELEASE and DEBUG. To be honest, I didn't get where such difference comes from and probably this is due to different compilation options used by RELEASED and DEBUG. Fix: After commit [2], serialize_precision is used for var_dump(). As a result, the pre-set "precision=14" didn't work actually. In this patch, we turn to set serialize_precision as 14 and therefore the difference between RELEASE and DEBUG can be eliminated. Note-1: this failue didn't occur on x86 machine. Note-2: in my local test, this is the only test case which behaves differently on ARM64 machine under RELEASE and DEBUG mode. [1] https://gist.github.com/shqking/0d55abf8dbaafde4a00ea9304e71f06b [2] https://github.com/php/php-src/commit/a939805 Change-Id: I9293e990925590f8d7cfb2462d8d760abf76069f
5.6 KiB
5.6 KiB