Environment:
- LDAP Server Type: ActiveDirectory
- PHP Version: 8.1 (32-bit)
Describe the bug:
In my Laravel 10.x project, I am getting a PHP Fatal error: Uncaught TypeError: DateTime::setTimestamp(): Argument #1 ($timestamp) must be of type int, float given. I investigated the bug, and it seems that 32-bit PHP does not handle the DateTime conversion properly.
Ever since #602, when the Utility functions were removed with the introduction of LdapRecord v3, the Utilities::convertWindowsTimeToUnixTime() function has been replaced with the code (int) ($value / 10000000) - 11644473600. The Utilities::convertWindowsTimeToUnixTime() function used to guarantee that an int was returned, but the new code does not have this guarantee, and returns a double on 32-bit PHP.
Perhaps it could be changed to use the code (int) (round($windowsTime / 10000000) - 11644473600) from the old Utilities::convertWindowsTimeToUnixTime() function?
Environment:
Describe the bug:
In my Laravel 10.x project, I am getting a
PHP Fatal error: Uncaught TypeError: DateTime::setTimestamp(): Argument #1 ($timestamp) must be of type int, float given. I investigated the bug, and it seems that 32-bit PHP does not handle the DateTime conversion properly.Ever since #602, when the Utility functions were removed with the introduction of LdapRecord v3, the
Utilities::convertWindowsTimeToUnixTime()function has been replaced with the code(int) ($value / 10000000) - 11644473600. TheUtilities::convertWindowsTimeToUnixTime()function used to guarantee that anintwas returned, but the new code does not have this guarantee, and returns adoubleon 32-bit PHP.Perhaps it could be changed to use the code
(int) (round($windowsTime / 10000000) - 11644473600)from the oldUtilities::convertWindowsTimeToUnixTime()function?