Hi, I was wondering when PHP 7.2 will be officially supported by Cake. I have the latest Cake version (3.5.9) and tried it with PHP 7.2.0 yesterday. The site seems to work fine (after I changed some config/app.php settings), but during unit testing (with PHPUnit 6.5.5) I’m seeing a ton of new PHP warnings. The only change I made was upgrading from PHP 7.1.12 to 7.2.0.
The warnings are new in 7.2 - I even saw them in PHP’s source code. They changed the way sessions are handled. Cake has some sessions code to help with this change but it doesn’t seem sufficient yet. Some people are calling the new warnings a PHP bug. So I was just wondering if the Cake team had plans or a timeline to address this. I want to use the new security features in 7.2 but I’d prefer to wait until all the warnings/notices disappear.
Here’s an example of the warnings:
session_set_save_handler(): Cannot change save handler when headers already sent
The warnings mostly occur during unit testing when a route is accessed. Technically, the warning is correct since PHPUnit has already output to the console when the route is accessed and the session is attempting to re-initialize.
The change I had to make to my app.php file was for the Sessions config. I had to copy all of the database defaults but leave the “session.save_handler” entry missing so that Cake wouldn’t try to set it to “user”, which is now an invalid option.