You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Language · php-src-strict · float→int deprecation · non-finite
Problem
Zend emits E_DEPRECATED: Implicit conversion from float INF to int loses precision when INF/NAN are coerced to int in untyped contexts (bitwise ops, array dim read/write), then continues with a truncated value. VM/JIT already emit that deprecation for finite non-integral floats (1.5) but stay silent for non-finite values — VmMath::floatLosesIntPrecision() returns false when !is_finite($value).
Related but separate from typed-int TypeError (#27925).
Repro (2026-08-05, Zend 8.2.32 / HEAD a2b5d7e5b)
Zend
VM / JIT
error_reporting(E_ALL); INF | 1
E_DEPRECATED then 1
1 (no deprecation)
$a=[1,2,3]; $a[INF]
E_DEPRECATED then 1 ($a[0])
1 (no deprecation)
1.5 | 2 (control)
E_DEPRECATED then 3
same (OK)
php-src reference
php/php-src Zend/zend_operators.c — zend_dval_to_lval / implicit float→long deprecation path (message still says “loses precision” for INF)
ext/standard/VmMath.php — floatLosesIntPrecision() / warnFloatToIntPrecisionLoss(): treat non-finite like Zend (emit the same E_DEPRECATED message with INF/NAN/-INF text), or mirror php-src’s exact branch for non-finite before truncate
Call sites already using warnFloatToIntPrecisionLoss (bitwise, dim) pick this up; audit dim-write path
Category
Language· php-src-strict · float→int deprecation · non-finiteProblem
Zend emits
E_DEPRECATED: Implicit conversion from float INF to int loses precisionwhenINF/NANare coerced to int in untyped contexts (bitwise ops, array dim read/write), then continues with a truncated value. VM/JIT already emit that deprecation for finite non-integral floats (1.5) but stay silent for non-finite values —VmMath::floatLosesIntPrecision()returnsfalsewhen!is_finite($value).Related but separate from typed-int
TypeError(#27925).a2b5d7e5b)error_reporting(E_ALL); INF | 1E_DEPRECATEDthen11(no deprecation)$a=[1,2,3]; $a[INF]E_DEPRECATEDthen1($a[0])1(no deprecation)1.5 | 2(control)E_DEPRECATEDthen3php-src reference
Zend/zend_operators.c—zend_dval_to_lval/ implicit float→long deprecation path (message still says “loses precision” forINF)warnFloatToIntPrecisionLoss)PHP implementation target
ext/standard/VmMath.php—floatLosesIntPrecision()/warnFloatToIntPrecisionLoss(): treat non-finite like Zend (emit the sameE_DEPRECATEDmessage withINF/NAN/-INFtext), or mirror php-src’s exact branch for non-finite before truncatewarnFloatToIntPrecisionLoss(bitwise, dim) pick this up; audit dim-write pathRepro
Expected Zend:
Done when
INF|1and$a[INF]emit Zend’sE_DEPRECATEDtext on VM and JIT, then same numeric result1.5path unchangedintstill TypeError per Language: weak typed int accepts INF/NAN — Zend TypeError (zend_operators.c zend_dval_to_lval_safe) #27925 (not deprecation)Trust snapshot (this maintainer run)
bootstrap-inventory --check: OK 7068/7068release-readiness --json:user_release_ready: no— helper-runtime-prelink stale (SprintfJitHelper/VsprintfJitHelper);north-star5-fastred (gen-0 mismatch Self-host M5: bootstrap-inventory argv driver size floor — grow beyond 451KB stub #8713)implementation-readyitems; no open PRs to merge this run