DDC-2243: Inconsistent PHP Type for "bigint" columns #2823

Closed
opened 2026-01-22 14:04:54 +01:00 by admin · 1 comment
Owner

Originally created by @doctrinebot on GitHub (Jan 15, 2013).

Originally assigned to: @beberlei on GitHub.

Jira issue originally created by user johannes:

It seems like columns of type "bigint" have no consistent PHP type.

If an object is read from the database, the database value seems to be cast to
a PHP string. However, directly after persisting an entity using an id generation strategy of "AUTO" the type is a PHP integer.

I think it would make sense to use a PHP string for both cases as you otherwise can run into problems if you use shallow comparisons such as "===".

Originally created by @doctrinebot on GitHub (Jan 15, 2013). Originally assigned to: @beberlei on GitHub. Jira issue originally created by user johannes: It seems like columns of type "bigint" have no consistent PHP type. If an object is read from the database, the database value seems to be cast to a PHP string. However, directly after persisting an entity using an id generation strategy of "AUTO" the type is a PHP integer. I think it would make sense to use a PHP string for both cases as you otherwise can run into problems if you use shallow comparisons such as "===".
admin added the Bug label 2026-01-22 14:04:54 +01:00
admin closed this issue 2026-01-22 14:04:55 +01:00
Author
Owner

@doctrinebot commented on GitHub (Jan 20, 2013):

Issue was closed with resolution "Fixed"

@doctrinebot commented on GitHub (Jan 20, 2013): Issue was closed with resolution "Fixed"
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#2823