[php-src] Issue #8255: using enum in $_SESSION variable causes session_start to error "Failed to decode session object. "

From: Date: Sat, 26 Mar 2022 17:54:45 +0000
Subject: [php-src] Issue #8255: using enum in $_SESSION variable causes session_start to error "Failed to decode session object. "
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-240512@lists.php.net to get a copy of this message
Issue: https://github.com/php/php-src/issues/8255 Author: RLievaart ### Description The following code: ```php <?php session_start() ; enum xxx { case A; case B; case C; } echo "Hallo, wereld" ; $_SESSION['test'] = xxx::C; ``` When run TWICE! Resulted SECOND TIME RUNNING in this output: ``` Warning: session_start(): Class 'xxx' not found in /home/admin/domains/vrijeuitgevers.nl/public_html/test/test.php on line 3 Warning: session_start(): Failed to decode session object. Session has been destroyed in /home/admin/domains/vrijeuitgevers.nl/public_html/test/test.php on line 3 Hallo, wereld ``` But I expected this output instead: ``` Hallo, wereld ``` ### PHP Version 8.1.4 ### Operating System Linux CentOs 7 -- 3.10.0-1160.59.1.el7.x86_64 #1 SMP Wed Feb 23 16:47:03 UTC 2022 x86_64

« previous php.bugs (#240512) next »