On 27 July 2017 18:03:23 BST, "li...@rhsoft.net" <li...@rhsoft.net> wrote:
>if that could work in the way that session_start() keeps the current 
>state of $_SESSION if not empty it would be possible to put the 
>APCU-Read and if exit($apcu_content); before session_start() which
>would 
>gain another 30% performance

I think that behaviour would confuse more people than it would help. If 
anything, it should be an error to access $_ SESSION if no session is currently 
open - if there is no session, the array has no meaning. (Arguably, all the 
other superglobals should be read only for the same reason, but that would be a 
huge break now.)

If I understand you right, the scenario you describe is "I don't want to start 
a session yet, but if and when I do, I want to put this data into it". It feels 
like that could be adequately handled in userland with a wrapper object (or 
global var and functions if you prefer), which reads to and from $_SESSION when 
a session is open, but a a holding array when it's not yet.

Regards,

-- 
Rowan Collins
[IMSoP]

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to