Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:100080 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 67050 invoked from network); 28 Jul 2017 12:48:57 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 28 Jul 2017 12:48:57 -0000 Authentication-Results: pb1.pair.com header.from=rowan.collins@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=rowan.collins@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.82.49 as permitted sender) X-PHP-List-Original-Sender: rowan.collins@gmail.com X-Host-Fingerprint: 74.125.82.49 mail-wm0-f49.google.com Received: from [74.125.82.49] ([74.125.82.49:38075] helo=mail-wm0-f49.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id C7/84-40376-8B23B795 for ; Fri, 28 Jul 2017 08:48:56 -0400 Received: by mail-wm0-f49.google.com with SMTP id m85so116641746wma.1 for ; Fri, 28 Jul 2017 05:48:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:user-agent:in-reply-to:references:mime-version :content-transfer-encoding:subject:to:from:message-id; bh=GkPwGbpGGOLmpQ3QMgi9choM97E9QvQanZ16dIJhMjg=; b=beXgaanbvunBiv20gmYQg+CMhN9Yg4Xwg1TICxgej9hvG187L6092j0oo6aYQlXKW/ +v3+78ieBeFvTAPskMcQ9L86ZCzdyuYMy/RX1UsGHEpUU8AEjhYVwTABnLziQBoOS8sr AKS+/Pelcn4OC8YIU4b2tZOE632mZNvl69dzm6z71nXHyqO8cBW6wnEv/zNONG+qQYk6 yiOyvDGBCDLbdZ6eSUBL1RiQj1BmUCfVgD3QPLQb5GpV6w0RVTdCjTZKV8pCmdsZqvOw VhVeV6u27wjO5fNTW829hCNdfziABjiMc5gtzhKDruFVwHUiRBakk9cHwjqNrYYOP846 rSgw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:user-agent:in-reply-to:references :mime-version:content-transfer-encoding:subject:to:from:message-id; bh=GkPwGbpGGOLmpQ3QMgi9choM97E9QvQanZ16dIJhMjg=; b=oVOqD+jvXEDq+5rnnDGfmtlJJASqc7PorUW2bwqBHDELMp7iTr10Bhh9fqlKGWYeYW kGkhLmt/cenoaUrdtHssDt4b1za+4GREORep1+g9Y3ZrRGqYs2iHoPD0EtkOMUGxQKtp LeZD6f5M7bNItcPIWB5t2uhubX07ULi5cCTUgU/QvNfWMGSJKawsj7e7CFImEi1jFX+Z 7KREnqcaYKWTWacq3H/fr500KiQ3WVNT+ucGyxNMD4S2nC0uuqeSTmgCXa1QxBGFEJIm 6LoWQeyhrHfmKc2UvI8SMiroe73hqM8ICEhdZ9zkCzDOqj02+jgNgT5MEchQF2TxHQyo dERg== X-Gm-Message-State: AIVw112A1LgDaakh16MdFha+ch4JMrfpL8c6NRYKtH12ssAgo9QA2OrA bG4QUHxyfY9xmYsHR7c= X-Received: by 10.28.229.207 with SMTP id c198mr5396105wmh.108.1501246133201; Fri, 28 Jul 2017 05:48:53 -0700 (PDT) Received: from [10.6.137.171] (188.29.164.166.threembb.co.uk. [188.29.164.166]) by smtp.gmail.com with ESMTPSA id 9sm19255906wmo.35.2017.07.28.05.48.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 28 Jul 2017 05:48:52 -0700 (PDT) Date: Fri, 28 Jul 2017 13:48:48 +0100 User-Agent: K-9 Mail for Android In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable To: internals@lists.php.net,"lists@rhsoft.net" ,Mailing-List php Message-ID: <28093140-0D0D-4157-AAA3-E8F1A570E67A@gmail.com> Subject: Re: [PHP-DEV] session_start() should not reset $_SESSIOn if it's not empty From: rowan.collins@gmail.com (Rowan Collins) On 27 July 2017 18:03:23 BST, "lists@rhsoft=2Enet" wro= te: >if that could work in the way that session_start() keeps the current=20 >state of $_SESSION if not empty it would be possible to put the=20 >APCU-Read and if exit($apcu_content); before session_start() which >would=20 >gain another 30% performance I think that behaviour would confuse more people than it would help=2E If = anything, it should be an error to access $_ SESSION if no session is curre= ntly open - if there is no session, the array has no meaning=2E (Arguably, = all the other superglobals should be read only for the same reason, but tha= t would be a huge break now=2E) If I understand you right, the scenario you describe is "I don't want to s= tart a session yet, but if and when I do, I want to put this data into it"= =2E It feels like that could be adequately handled in userland with a wrapp= er object (or global var and functions if you prefer), which reads to and f= rom $_SESSION when a session is open, but a a holding array when it's not y= et=2E Regards, --=20 Rowan Collins [IMSoP]