Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:129742 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 5E3211A00BC for ; Thu, 8 Jan 2026 20:15:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1767903344; bh=79JxXwLnDaZ2PMvwvUZ9VEyEwPoH47VFGM2LEQU0GU8=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=aK1bzpqM1FpuN421pAxYbVVlN6vE3vNDvBnJXpMwgBgkdpUz66cV/z2ff8yK7j2+Y EtByqXNnoRTsbbJJ93YFFyTLUU0U6GFv9dZwWvx5vMAxObhRqsV+reZ4qLSBF0/V6x wumUqS/5h3SxZt8TweRomGD7JphDYHKMfCa0wZLEW2ZrG0TSAuEqNDxHvS8zNN3Nsk UP7Uha9waddWoDbhoav+zMx3cCgz838xd3o+dUyTFZfnP4xO9vXgaR98f+Mi37oGCF SAvb3PE9BW5kTK5qbJ0Ps6cLk8A2VkhpY3j0aGhZvwf1B0DN29gIkH7Az2aC8ftN4k NpwszBVk3O/5A== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id DECDF180041 for ; Thu, 8 Jan 2026 20:15:40 +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.9 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS, FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,T_SPF_TEMPERROR autolearn=no autolearn_force=no version=4.0.1 X-Spam-Virus: No X-Envelope-From: Received: from mail-pf1-f180.google.com (mail-pf1-f180.google.com [209.85.210.180]) (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 ; Thu, 8 Jan 2026 20:15:40 +0000 (UTC) Received: by mail-pf1-f180.google.com with SMTP id d2e1a72fcca58-7b89c1ce9easo2534314b3a.2 for ; Thu, 08 Jan 2026 12:15:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1767903334; x=1768508134; 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=79JxXwLnDaZ2PMvwvUZ9VEyEwPoH47VFGM2LEQU0GU8=; b=guxWRPVmsx8NLxRS5Omp+oOgTLUiMSMCsFWpD7wLxVyM0smEt4ZFZQ6pmWGpYheOz1 sBdxzDRUutcpEzKLIlSTQah57UMmFEJ2WAbER6vFDNaVoSQLClHpS0FgBoZZDTj6+JdQ r+PkTZzrnmjivIx1sQvN17lYrVrcRfqRndGkgmiCZqsjCU1hghHJ9EZnZzwiPXz9K89M 29ryLg0zbLfc6j9c0akyydoYhws9RPJ9vi6tTJ2OLX4r5nrZFI5lWScWQA2+U1+BLnVW FDAUBb2KdtCFiwZD8u45uV5ZfxKpJIwQMZsfJKE1mWu7+R5tpRruYwNGg9jpMmbbEvUs WnLw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1767903334; x=1768508134; 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=79JxXwLnDaZ2PMvwvUZ9VEyEwPoH47VFGM2LEQU0GU8=; b=vNZjGbPERLoFVjIkYr0o6TwlXoDAff+WqKjAZDpnt4CzX1mX66kMSLqjqoFj7KBLy4 D8oZT59SpGpTenkeWS6jrJW18ws5qKxLqq/dLz/qP86rTGVzfQhq38yroblLVH3awq6F YzP/woawV8dsiibZPbsgxuIIqnlIcuPhPbwAKN5zm68S7S9bYltJy5faI7ZNtYy2vPrQ uswYIva/1bIbUNCHYoXTZcUK2ElJVjssVqAFsSJJEMEoOCX4P1lKrrOG03wU59ZH/K5q Y+Uw0sLpqBRKcqUJtFGd/UjfYDdoo+qo1vplf3IGm1a7TKCS79WE0YIvsJ/Qc3htVNrx EmFA== X-Gm-Message-State: AOJu0Yyica+q6ampEXCzu5nJozmR//NaFLjx0w2ULfMHPqmusUviGa0f Jsq8De2/36qKCCsZGg77uFWgkUthnCU7B4lhD1JFtguckjXjizPXZZ1Gx0ecsDSzEImOLcojkSo w03T5Xg4BAbuDncaKQehgGJwhnNKA+0O4bIeU X-Gm-Gg: AY/fxX42W+9NYn5ISN325LCbYDUTVID6vgIRRsWnHEAaYUUxIxEhpMJqgGj0V/5FS6S rilln/Gjgf4pAUZOlsN1UJFhNl0QY+QMysSQ3UgPf+2UlLP+R/u9rqFVFzt+5MCHUURibFGcsG6 nwU5grqSBmQBKBGzdKNa3Dm8QaRn4McTKMOG7ttBh9LBonpL2VEJ/ST5LZuE6S6H+VE52A0Lw21 lGoGMFLqbk4QMpB5iLN9J6mdoxXEToieTDhixwWr+wxf3zm1stUGkqoUwcWfVOhMIoC+3TIJ38g e8wAcg== X-Google-Smtp-Source: AGHT+IGuj+IxrIy3IG0PJEwsdT1Q8v0gCchR9YC/v/us8qrLKd5iUAYwKw4wWZAG7+p6c22gXq2mzjp4kFrA81FebN4= X-Received: by 2002:a05:6a20:6a03:b0:387:963b:68ae with SMTP id adf61e73a8af0-3898f9fa9f9mr6831504637.80.1767903334483; Thu, 08 Jan 2026 12:15:34 -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: Thu, 8 Jan 2026 20:15:19 +0000 X-Gm-Features: AQt7F2ov604_MNG2_En-7WSr5klidq0JB5HGJC3lpeEmeLbptYjw4tyOI5XZ8i0 Message-ID: Subject: Re: [PHP-DEV] Improving PDO persistent connections and event loop support To: go.al.ni@gmail.com Cc: internals@lists.php.net Content-Type: text/plain; charset="UTF-8" From: tekiela246@gmail.com (Kamil Tekiela) Hi, 1. Automatic cleanup is something that we could add to PDO, at least for MySQL. I am not sure if other drivers have reset methods. The cleanup should probably happen when requesting the connection again. 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. It is silently discarding errors and data, which could be disastrous in some situations. If such a feature is added to PDO, it should be opt-in, so that users aren't automatically enrolled in a dangerous feature. 2. A reset method sounds really reasonable, even if it is only a driver-specific method for MySQL. It should probably use mysql_reset_connection(). If this method is added, then we don't need to bother adding automatic cleanup, as this would be a far better option. > 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. > But in event loops this may be complicated because of internal references to PDO object from PDOStatement objects And that's very good. As long as any PDOStatement or PDO objects refer to the connection, it should NOT be closed. Giving users such an option would only result in creating crippled objects for no apparent benefit. I stand by what I said before: in a well-designed application, there is absolutely no reason to close the connection explicitly. Regards, Kamil