Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:129786 X-Original-To: internals@lists.php.net Delivered-To: internals@lists.php.net Received: from php-smtp4.php.net (php-smtp4.php.net [45.112.84.5]) by lists.php.net (Postfix) with ESMTPS id 0AB1D1A00BC for ; Mon, 19 Jan 2026 12:27:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1768825647; bh=abMDyFci6OvqvyCzQXGSZJXungpd6MUQaf1HxE2ZYOM=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=cf7+Bfzyq3aoqVfiANPA790VDuwx+NMCxHlir4c5mPbR2aVrgBayKs+DFGcHoAg/F EZh5MuT6za/n/Bg8YH4cauJ/roTMFZrINTtSfkeFrs0Sotr5sxQQji+XzPWEuRlbdb FD6DyZif9t1XE32R4Ejs8BdsLrq4Y+b7AB7k2/6JY9ovAK24zbgG9l4B7SzYogkKsK gdYGBwxx4AcT0FcNitjqMzDUAOwPG0VgbuCvlhm8mREPUzytne1c/ijPnqirTvdM/z dC+1bfBfZoofFSNFGC8+B8VI4thiEbrIAZydiimJlPghvRPVwQjaeoB+SVtv9CK50K 7gOXoeDwpKyeQ== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id D1E63180056 for ; Mon, 19 Jan 2026 12:27:26 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=0.6 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_50, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS, FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=4.0.1 X-Spam-Virus: No X-Envelope-From: Received: from mail-qk1-f174.google.com (mail-qk1-f174.google.com [209.85.222.174]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Mon, 19 Jan 2026 12:27:26 +0000 (UTC) Received: by mail-qk1-f174.google.com with SMTP id af79cd13be357-8c6a822068eso391679585a.3 for ; Mon, 19 Jan 2026 04:27:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1768825641; cv=none; d=google.com; s=arc-20240605; b=T3vMvGLqTS3R6adQKmSKSUo0PYtxFNh3xy0oLjPnd8fhhItXbHnD7MOfNo+H9Cos4M AX+PVgo3qPU1imzhMsKiUDS6/gf40Bz+fDsZ5g5p5XH0doIiycy9nyLl57oQ2UeNjjGT 6bWkG18uxHaaMlwTjOQBkH7OHkjHc6H7EnH1wyfUQlOTwY+UpP15GtmMMy7KstY7/hXd CFoJtkBQznly2mJg34beRReEo+GkuGRudp3A3EpWUvsZPT3SYTloPDewKrnS5e2QfI9p LgbpWTfaPU6Sck3b0VdIzDJib5t6ZjebzYxdWsgKVQfYUzvSo61SpErRpcGT8wMv29WL dNVg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:dkim-signature; bh=tVKxEPHQDtM3I58EseU+uY5+Ay38dv2ESHlmuicUuIM=; fh=GbLssEDpFkOs4sxVotj6CryJN2OQBdvy0mK7+XaIMqE=; b=kFjUVKq6+SRKtXtIf6U6/obhkZhZYvyCALDsdhfQbddW3DRxBlSHIUVVL7D4RvSSYg rlRJcygy5B0IiMztO+rHAZACV8FhsQD0xmyjWnyilCAyJpzPtgcsflXQMTH9sBFoY0JG nYjJ9mrTMk0QbX7rSNejLr5A9bgB7gWCc5p6AGIvLR0d+zD+LVNj9QjcfcfbhoodGc6P rPsrNnERoAwBXF2NoYc+QCNMj70yGee9JIY9VYGRYnpKA0kBA+i9YX9UK1DhCcZ1RC7M I7b0WDTYeWF1mpl+0cAfFf7BVHqvZTwWcixO6I6hC+G5ml6FLraQlCTzk4bZoBmZ+nmo VcmA==; darn=lists.php.net ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1768825641; x=1769430441; darn=lists.php.net; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=tVKxEPHQDtM3I58EseU+uY5+Ay38dv2ESHlmuicUuIM=; b=AlcnmVJ1N/kdUfBM306z80M++1/p6BIxCj8ZJdnP6MEWyVVdiEO7zIeqTbm+G+eQoi MGORBAyCL1Y5h6uCf9JZQHz02bzh/4LrG6RT0HoiV2wLNvE/IdSgA3Fo2iJFh5ihJrZD t4ezabvg9Qavq1O1EDTcwO57+bLI7g/znMQGyWwxLqXR7qILjhAWSpMM8M90oN0fPrcF otLy+mmiR/teIeX/kCmHK4my1iAZVn743I09clvbOUOJu+/dLQRCnnVMKuFsrhm37liY T3M3fcatxM2K+dI0+L+nlY5qX86D5dzZcU9U5pmLvoJ+TlKb5bn79TeNV94u8PdJQGHS vXsQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1768825641; x=1769430441; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=tVKxEPHQDtM3I58EseU+uY5+Ay38dv2ESHlmuicUuIM=; b=SUi8qVsesDIk0ntByfk3N/XKnj1HCnHMTDIcyk8ZaBHKOY72/ytttzr5WOa1dUK9AD YVPkkxt9+t0p6Clt9E1YE/YcSpYqjycDdaJQ+hTTk+97rHYAFmLnGavzidkKsN9i0cuP tkr+K3J9Am8EaF4hdnFbIH8SQ/SPtIUMRuzdNslr/GDrULYkYj2yOx8Affm3NIfn37Wm 5eb0++0XGO7NkMshD99OwxomUMRydtMuGCOBds0QI7HdfUodZdHx6DISjAKN2la2FJNt JD9Jb5P9q3oNNV5WDyH4W48NdKBzkh1NpWY5s7Qh5vhPgka9mjoZEblnbCXV5GpLNq9s eK7g== X-Gm-Message-State: AOJu0YxvZY1lzh3rXFwOZ3e+UuPtCokd2HRWi9RW1rbdyJInjJxhb+ja oTDqShPLy+/marseDPMB0pKfI7gVm6Gv1wYROpS3j/4rRBuhK5P4mQ14ICbwRFpJPf4SaiggUYY fTVcHN8QfczbpVmrXYnaEcADtFqOiyo4= X-Gm-Gg: AY/fxX4z/j0A7MDHxXq9eYU1w69xuQkbZUXIAhNTWUwuyeews9LOPWeTwOfGG0GC6dc QmDlbZ9pCGBYd1T8p7VDDrStqsjZwskRwSHlkzuOYRts3zUKczOdcdl2LXbetMlvN1h+nLQ1Lxk ox3YbzAhtZsCLQ/ZOF7uckFUlp2Jei1aynNUT2wkBefKXQs3Kf6HeBz7nTto203FY/attthHbbO wc/qIlynGeDznf+gQVbg5GMN9KluCa/HGqBqR/TOORm+DjRePVLYSpIwuVSYe5CLvpjXg== X-Received: by 2002:a05:620a:7118:b0:84a:5f9d:a30c with SMTP id af79cd13be357-8c6a695571cmr1613916085a.63.1768825640813; Mon, 19 Jan 2026 04:27:20 -0800 (PST) Precedence: list list-help: list-unsubscribe: list-post: List-Id: x-ms-reactions: disallow MIME-Version: 1.0 References: In-Reply-To: Date: Mon, 19 Jan 2026 15:27:09 +0300 X-Gm-Features: AZwV_QgxFUmeZ7KfKSXgOwKA14mPDL6h6E0cBm1G2PxMH-kcjRvRZUh_4PIxLqc Message-ID: Subject: Re: [PHP-DEV] Improving PDO persistent connections and event loop support To: Kamil Tekiela Cc: internals@lists.php.net Content-Type: text/plain; charset="UTF-8" From: go.al.ni@gmail.com > But there is a reason why mysqli allows for this feature to be > switched off in the compilation options. Certain users do not like > this. I'm pretty sure this option introduced not by user demand. But because maintainers thought it may be useful. This should be opt in. Because backward compatibility, not because someone disliked it. Can't imagine situations where obtaining dirty connect from previous script execution would be useful. This may be implemented using pdo option: ```php $db = new PDO( 'dsn', 'user', 'password', [ PDO::ATTR_PERSISTENT => true PDO::ATTR_AUTO_RESET_PERSISTENT => true, ] ); ``` > It is silently discarding errors and data, which could be > disastrous in some situations. That's exactly what I want - not bothering about errors and data left from previous script. >> PDO does not have method for closing connection. > As I said in an earlier email, this is intentional. Such a method is > a bad idea. We have mysqli::close and this is ok. But PDO::close is a bad idea? I don't understand. > I stand by what I said before: in a well-designed > application, there is absolutely no reason to close the connection > explicitly. Creating well-designed application is hard. As a creator of event loop framework I can't be sure that every user of my framework is a superstar in programming and application design. So I'd prefer to leave my users with "crippled objects" that would fail-fast in the next loop iteration instead of invisible db connection leak. This is also very suitable for True Async RFC [1]. In that case if you want send queries in parallel coroutines, then db connection pool should be used. And for connection pool implementations it's mandatory to have possibility to close db connection explicilty. [1] https://wiki.php.net/rfc/true_async