Skip to content

Commit

Permalink
Merge pull request #49 from MauricioFauth/php-8.3
Browse files Browse the repository at this point in the history
Add support for PHP 8.3
  • Loading branch information
boesing committed Oct 1, 2023
2 parents b7d612e + 6a6359a commit 9641dee
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 5 deletions.
5 changes: 4 additions & 1 deletion .laminas-ci.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,8 @@
"bcmath",
"igbinary",
"msgpack"
]
],
"ignore_php_platform_requirements": {
"8.3": true
}
}
14 changes: 14 additions & 0 deletions .laminas-ci/pre-install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/bash

PHP_VERSION=$4

if [ "${PHP_VERSION}" != "8.3" ]; then
exit 0;
fi

set -e -o pipefail

pecl install igbinary msgpack

echo "extension = igbinary.so" > /etc/php/${PHP_VERSION}/mods-available/igbinary.ini
echo "extension = msgpack.so" > /etc/php/${PHP_VERSION}/mods-available/msgpack.ini
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
}
},
"require": {
"php": "~8.0.0 || ~8.1.0 || ~8.2.0",
"php": "~8.0.0 || ~8.1.0 || ~8.2.0 || ~8.3.0",
"laminas/laminas-json": "^3.1",
"laminas/laminas-stdlib": "^3.2"
},
Expand Down
4 changes: 2 additions & 2 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 8 additions & 1 deletion src/Adapter/PhpSerialize.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@
use function unserialize;

use const E_NOTICE;
use const E_WARNING;
use const PHP_MAJOR_VERSION;
use const PHP_VERSION_ID;

class PhpSerialize extends AbstractAdapter
{
Expand Down Expand Up @@ -130,7 +132,12 @@ public function unserialize($serialized)
return false;
}

ErrorHandler::start(E_NOTICE);
$errorLevel = E_NOTICE;
if (PHP_VERSION_ID >= 80300) {
$errorLevel = E_WARNING;
}

ErrorHandler::start($errorLevel);

// The second parameter to unserialize() is only available on PHP 7.0 or higher
$ret = PHP_MAJOR_VERSION >= 7
Expand Down

0 comments on commit 9641dee

Please sign in to comment.