[wp-trac] [WordPress Trac] #64767: Some PHP Warnings appears with PHP 8.5

WordPress Trac noreply at wordpress.org
Sun Mar 1 17:10:59 UTC 2026


#64767: Some PHP Warnings appears with PHP 8.5
-----------------------------+------------------------------
 Reporter:  phil78180        |       Owner:  (none)
     Type:  defect (bug)     |      Status:  new
 Priority:  normal           |   Milestone:  Awaiting Review
Component:  General          |     Version:  6.9.1
 Severity:  normal           |  Resolution:
 Keywords:  php85 has-patch  |     Focuses:
-----------------------------+------------------------------
Changes (by yasirkhalifa):

 * keywords:  php85 => php85 has-patch


Comment:

 I18N: Prevent PHP 8.5 float-to-int warnings in WP_Translation_File_MO.

 On PHP 8.5+, large unsigned 32-bit integers returned by unpack() may be
 represented as floats on some platforms. Subsequent implicit casting can
 trigger warnings such as:

 "The float 2500072158 is not representable as an int, cast occurred"

 This patch introduces a helper method to normalize unpacked uint32 values
 and applies it to header and entry offsets before comparisons and
 arithmetic operations.

 This ensures consistent unsigned 32-bit handling and prevents float-to-int
 casting warnings while maintaining existing behavior on both 32-bit and
 64-bit platforms.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/64767#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list