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
Twitter message ids are very large, and are too big to be represented by a 32-bit integer. The int type hint on the declaration of \PeeHaa\AsyncTwitter\Api\Request\Status\Update::replyTo() causes a TypeError on 32-bit PHP:
TypeError: Argument 1 passed to PeeHaa\AsyncTwitter\Api\Request\Status\Update::replyTo() must be of the type integer, float given, called in D:\projects\phptek-asynch\twitter-bot.php on line 43 in D:\projects\phptek-asynch\vendor\peehaa\async-twitter\src\Api\Request\Status\Update.php on line 19
Originally I was thinking that this could be avoided by simply removing the type hints, but my testing shows that it won't work because PHP converts the integer to a floating point, losing some precision in the process as show in this partial print_r output of a status update: Array ( [created_at] => Wed May 24 01:21:10 +0000 2017 [id] => 8.6718869400397E+17 [id_str] => 867188694003974148 )
The only solution is to require 64-bit PHP.
The text was updated successfully, but these errors were encountered:
jsmitty12
added a commit
to jsmitty12/AsyncTwitter
that referenced
this issue
May 24, 2017
Twitter message ids are very large, and are too big to be represented by a 32-bit integer. The
int
type hint on the declaration of\PeeHaa\AsyncTwitter\Api\Request\Status\Update::replyTo()
causes a TypeError on 32-bit PHP:TypeError: Argument 1 passed to PeeHaa\AsyncTwitter\Api\Request\Status\Update::replyTo() must be of the type integer, float given, called in D:\projects\phptek-asynch\twitter-bot.php on line 43 in D:\projects\phptek-asynch\vendor\peehaa\async-twitter\src\Api\Request\Status\Update.php on line 19
Originally I was thinking that this could be avoided by simply removing the type hints, but my testing shows that it won't work because PHP converts the integer to a floating point, losing some precision in the process as show in this partial
print_r
output of a status update:Array ( [created_at] => Wed May 24 01:21:10 +0000 2017 [id] => 8.6718869400397E+17 [id_str] => 867188694003974148 )
The only solution is to require 64-bit PHP.
The text was updated successfully, but these errors were encountered: