php/php-src — pull request #634 by yohgaki (2014-03-27 10:16:42+00:00)
Title: Raise errors for invalid session function calls or return execution status?

Session functions are better to raise errors for invalid calls or proper return status.

There is problem for session_write_close(session_commit). session_write_close() is registered as shutdown function when object based save handler is used. Since user may call session_write_close() in script, session_write_close() may be called against already closed session and raises error for it.

Other issue is current session functions(session_write_close() for example) do not return execution status. It's better to return execution status rather than NULL always.

We have 2 choices,
- Raise E_NOTICE for invalid calls for all functions.
- Return status only and do not raise error.

If we choose to raise error for invalid calls, session_write_close() error during shutdown must be fixed somehow.