Hi Stas,
On Fri, Jan 15, 2016 at 5:22 PM, Stanislav Malyshev <[email protected]> wrote:
>> Read failure is special because old save handler allowed returning false
>> for read and continued as if there is no errors. I cannot fix this without
>> braking buggy save handlers compatibility.
>
> Ah, you mean when read actually worked but handler returns false? If the
> session is set up correctly, then returning true is OK I guess.
There are many codes like
function read($id) {
return @file_get_contents(FILE_PATH.$id);
}
It returns FALSE for non-existing session data. i.e. The first access to the
server.
To make it work, user should either
- check file existence and return '' (empty string)
- cast FALSE to "string" to get '' (empty string). e.g.
(string)@file_get_contents()
So I cannot return FALSE on session_start() read failure w/o breaking
existing codes. PHP 7.0 is strict for return values, so session_start()
returns FALSE on read failure. Even if it is expected behavior for PHP
7.0, there was bug report on this, though.
Regards,
--
Yasuo Ohgaki
[email protected]
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php