+ /**
+ * Workaround for PHP5 bug
+ *
+ * PHP5 has a bug in handling boolean return values for
+ * SessionHandlerInterface methods, it expects 0 or -1 instead of true or
+ * false. See <https://wiki.php.net/rfc/session.user.return-value>.
+ *
+ * PHP7 and HHVM are not affected.
+ *
+ * @todo When we drop support for Zend PHP 5, this can be removed.
+ * @return bool|int
+ * @codeCoverageIgnore
+ */
+ protected static function returnSuccess() {
+ return defined( 'HHVM_VERSION' ) || version_compare( PHP_VERSION, '7.0.0', '>=' ) ? true : 0;
+ }
+
+ /**
+ * Workaround for PHP5 bug
+ * @see self::returnSuccess()
+ * @return bool|int
+ * @codeCoverageIgnore
+ */
+ protected static function returnFailure() {
+ return defined( 'HHVM_VERSION' ) || version_compare( PHP_VERSION, '7.0.0', '>=' ) ? false : -1;
+ }
+