ed3
February 21, 2026, 9:48am
1
Hi,
I used for this test:
OS: windows
CakePhp: 5.3.1 (with debugkit activated)
Php: 8.4 (x86)
When open default page I have following message:
Cake\Database\Schema\Column::__construct(): Argument #5 ($length) must be of type ?int, float given, called in \vendor\cakephp\cakephp\src\Database\Schema\TableSchema.php on line 381
How can we reproduce this? What database schema/structure do you have? Can you provide a SQL dump without data?
Likely a strict type issue
In TableSchema.php around line 381, there’s likely code like:
new Column($name, $type, $nullable, $default, $length, …)
Where $length comes from database metadata and isn’t being cast to int.
Check out Cast float column attributes to int for PHP 8.4 compatibility by dereuromark · Pull Request #19295 · cakephp/cakephp · GitHub
I am just wondering where a float length definition would make sense.
1 Like
ed3
February 22, 2026, 10:55am
5
I used default settings, the message appear to create sqlite database for debugkit.
The most interesting thing is that on php 8.4(x64) it works and on php8.4(x86) it doesn’t work.
so you are saying you just created a fresh cakephp 5 project, started it and it threw this error when you opened the browser?
ed3
February 22, 2026, 2:03pm
7
That’s exactly how it is!
so its a x86/32-bit PHP specific problem… weird
I added the details into the PR, on why is this happening. Quite weird behavior of PHP here indeed.
ed3
February 27, 2026, 8:14am
10
@dereuromark
I tested more and all versions of php 8 (8.2, 8.3, 8.4, 8.5) have the same behavior on x86/32-bit.