Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:113297 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 34501 invoked from network); 27 Feb 2021 13:29:08 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 27 Feb 2021 13:29:08 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 31A3F1804B3 for ; Sat, 27 Feb 2021 05:18:37 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,HTML_MESSAGE, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from mail-oi1-f169.google.com (mail-oi1-f169.google.com [209.85.167.169]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Sat, 27 Feb 2021 05:18:36 -0800 (PST) Received: by mail-oi1-f169.google.com with SMTP id l133so12912773oib.4 for ; Sat, 27 Feb 2021 05:18:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=XL1YL7ME6HDGz5TQcomsezoRouEmL2p9jxCvPmPegf4=; b=grTW1cxx8CpSXa9sN/AQLgNn2hUyqM6fqnZ5XvhV9hiwaSsOH8wEbRYPw9Pk0TfXw6 qWfg4H5CQNrWT2SrkkLWYq6lzjEidqb3XPpIPSa09q7EaE5H5TtZ+kt9eWP+S7nJB1Sc TDMxWFBb8/wNLLOcNr/77jtAGLz31I4V3WsSt1TIv2iiBae000kScUK1wb/pK/e+n3fn XcUHLFt2CBBaQk12FyCR1EdZ1mA6862XBzntgjE+0T9L4wUQmWqfkaGKPms+3bODymFj 4sQZT9bwKf0IMEIQyJ4pBhQJesbXLsJPFCeMg35TgiiiARnIq+jf5XnXPaXJyzofbofe XD1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=XL1YL7ME6HDGz5TQcomsezoRouEmL2p9jxCvPmPegf4=; b=C9ceKQmEPAbFjWKu5wE9oHje3MOmeObqAObKIoPWhrhlz7lT5cJgJnwiKU+Fv+P7tK 3THV3XD29RGtSX/nVCGX91gCKXnXr3QgCbUxwC2hq8wkfeDQGxqWx0NlFcpLecPK6kR/ 2dnClw+gGsbsOFWd1AWH4V1lcwliiNmHV3NczVnhTQ6vWKwA3NjqzmOrjXOL3lFzdpkV qbd62u0Jo37zl8KRGg3ZOlZQGzFO8u67F/pW0gjWtomIj6JHe87Ux4iBOnOZID2uIMdj J3eE/q+RsSgXNRnmJlPgogm9rPVyFNRTiWMBhj0JDpl+1k/MztSpbkv5wOMzWPOtnsG4 WxZg== X-Gm-Message-State: AOAM533T7uCWPgLnARKR/F55WnU9DXGt1zkaSoZ13QXtrfk/1hNMys2W br/elQT7V8Aptn2D/no41E/F2jMbBdNJLYaBJns= X-Google-Smtp-Source: ABdhPJyJnwQM3grKmU1fE107Q7UfrxmNQ/JSmuDJ354ffz0eOzl26mei7H0RBFqJymSfr3BBCglxMFFL89kMyC7Aw04= X-Received: by 2002:aca:ed85:: with SMTP id l127mr5579422oih.152.1614431915020; Sat, 27 Feb 2021 05:18:35 -0800 (PST) MIME-Version: 1.0 References: <499c2591-fb11-1b9d-d402-39f7ec1c6b85@themad.com.au> <6EC89E9A-035D-4D2B-97D7-845DC4FF3E32@koalephant.com> In-Reply-To: <6EC89E9A-035D-4D2B-97D7-845DC4FF3E32@koalephant.com> Date: Sat, 27 Feb 2021 13:18:24 +0000 Message-ID: To: Stephen Reay Cc: Matty The Mad , PHP internals Content-Type: multipart/alternative; boundary="000000000000cf16f805bc513855" Subject: Re: [PHP-DEV] PDO integer changes in 8.1 will stop many websites I support From: davidgebler@gmail.com (David Gebler) --000000000000cf16f805bc513855 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Apologies, in respect of point 1 in my reply, I misread your original message and didn't realise you were referring to the upcoming 8.1 change, thought you were referring to the current 8.0.1 release. This change AFAIK only affects emulated prepares and is an improvement, as previously you needed to have emulation off to get the correct data types. With modern PHP, MySQL and mysqnd there is not really a reason for anyone to be using emulated prepares anyway so my advice on points 2-5 remains the same. Dave On Sat, Feb 27, 2021 at 12:55 PM Stephen Reay wrote: > > > On 27 Feb 2021, at 15:56, Matty The Mad wrote: > > > > =EF=BB=BFPHP 8.1 PDO has been changed so that when MySQL returns an int= eger it > will no longer be returned as a string, but as an int. > > > > The problem is this breaks any sites that use UNSIGNED ZEROFILL integer > fields in MySQL. > > > > I support a number of websites where the phone numbers and post codes > are all UNSIGNED ZEROFILL. > > > > The post codes in MySQL are stored as 0800. > > > > In PHP 8.0 returned as string 0800 > > In PHP 8.1 returned as integer 800 > > > > 8.0.2 > > string(10) "0742000000" > > > > 8.1.0-dev > > int(742000000) > > > > PDO shouldn't really be changing the data. > > > > I propose that: > > =E2=80=A2 any ZEROFILL integers are returned as string [or] > > =E2=80=A2 there's an option to control this when making the connection = (I don't > want to str_pad() at every place I've used ZEROFILL in the past) [or] > > =E2=80=A2 this backwards compatibility breaking change is removed until= PHP 9. > > > > Matthew Asia > > > > -- > > PHP Internals - PHP Runtime Development Mailing List > > To unsubscribe, visit: https://www.php.net/unsub.php > > > > I agree it should be configurable, but storing digit strings as integers > is asking for trouble. > > Edit: Whoops, sending again from on-list address. > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: https://www.php.net/unsub.php > > --000000000000cf16f805bc513855--