| 
        php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | 
 PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits             
             [2021-04-30 11:14 UTC] cmb@php.net
  [2021-05-03 08:48 UTC] mbeccati@php.net
 
-Status:      Open
+Status:      Closed
-Assigned To:
+Assigned To: mbeccati
  [2021-05-03 08:48 UTC] mbeccati@php.net
  [2021-05-03 10:44 UTC] appmaker at nibnut dot com
  [2021-05-03 10:46 UTC] mbeccati@php.net
  [2021-05-06 13:10 UTC] josh at kimmel dot com
  [2021-05-06 20:55 UTC] valentin dot funk at gmail dot com
  | 
    |||||||||||||||||||||||||||||||||||||
            
                 
                Copyright © 2001-2025 The PHP GroupAll rights reserved.  | 
        Last updated: Tue Nov 04 04:00:01 2025 UTC | 
Description: ------------ It seems that, since using 8.0.5, booleans are cast to integers when inserting records into a PostgreSQL database table. This causes PostgreSQL to throw an exception. I use Laravel to do this, so it's not trivial for me to create a test script that's only PHP. However, I did want to report this as it seems to be an unintentional breaking change. How did I determine this isn't related to Laravel or PostgreSQL? I tested my project with the php:8.0.3-fpm-alpine and php:8.0.3-fpm-alpine docker images. 8.0.3 works fine, 8.0.5 gives me the error below. I did not change the Laravel version, nor did I change the PostgreSQL version. The boolean true seems to have been casted to an integer in the SQL shown in the error message. Test script: --------------- ProductCategory::create([ 'name' => 'FooBar', 'is_active' => true, ]); ProductCategory is a Laravel model. Expected result: ---------------- The record is added without errors or warnings. Actual result: -------------- Illuminate\Database\QueryException: SQLSTATE[42804]: Datatype mismatch: 7 ERROR: column "is_active" is of type boolean but expression is of type integer LINE 1: ...e", "id", "updated_at", "created_at") values ($1, $2, $3, $4... ^ HINT: You will need to rewrite or cast the expression. (SQL: insert into "product_categories" ("name", "is_active", "id", "updated_at", "created_at") values (FooBar, 1, 1eba993a-28f3-6596-9455-7e5293aad700, 2021-04-30 11:08:31, 2021-04-30 11:08:31))