Bug #75628 [Asn->Nab]: session_set_save_handler() prints warnings in a unit test

From: Date: Tue, 02 Oct 2018 10:35:01 +0000
Subject: Bug #75628 [Asn->Nab]: session_set_save_handler() prints warnings in a unit test
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-217347@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=75628&edit=1 ID: 75628 Updated by: yohgaki@php.net Reported by: damyon at moodle dot com Summary: session_set_save_handler() prints warnings in a unit test -Status: Assigned +Status: Not a bug Type: Bug Package: Session related Operating System: Linux Mint 17.3 Rosa PHP Version: 7.2.0 Assigned To: yohgaki Block user comment: N Private report: N New Comment: You cannot change anything for session, once you have started output. echo ".\n"; $success = session_set_save_handler(new MySessionHandler(), true); echo ($success ? 'set' : 'fail') . "\n"; echo should print 'fail', but it's not. This must be bug. I'll look into this. If you want to start output before session initialization, use ob_start() prevent PHP from start sending output. Previous Comments: ------------------------------------------------------------------------ [2018-10-01 13:39:24] jeroen at asystance dot nl 7.1.22 are fine, and 7.3.0RC2 fails. ------------------------------------------------------------------------ [2018-09-28 15:31:18] jeroen at asystance dot nl 7.2.0alpha1 already has this regression. I'm trying to pinpoint the commit that causes this bug but it's a slow process. ------------------------------------------------------------------------ [2018-07-27 11:37:53] jeroen at asystance dot nl I've written a php test case (phpt) for this bug. It fails on a fresh build of 7.2.8 (./configure without any flags). --TEST-- Bug #75628 (session_set_save_handler() prints warnings in a unit test) --SKIPIF-- <?php if (!extension_loaded("session")) die("skip session extension not available"); ?> <?php unlink(__DIR__. '/sess_' .session_id()); ?> --INI-- session.use_cookies=0 session.cache_limiter='' --FILE-- <?php class MySessionHandler extends SessionHandler {} echo ".\n"; $success = session_set_save_handler(new MySessionHandler(), true); echo ($success ? 'set' : 'fail') . "\n"; --EXPECT-- . set This bug is clearly a regression in 7.2 and prevents users from running (PHPUnit) tests against code that sets session handlers. ------------------------------------------------------------------------ [2018-07-27 11:37:53] jeroen at asystance dot nl Related To: Bug #75628 ------------------------------------------------------------------------ [2018-05-31 15:12:30] jeroen at asystance dot nl Confirmed in version 7.2.5. ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at https://bugs.php.net/bug.php?id=75628 -- Edit this bug report at https://bugs.php.net/bug.php?id=75628&edit=1

« previous php.bugs (#217347) next »