Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 479efc5

Browse filesBrowse files
bug #34419 [Cache] Disable igbinary on PHP >= 7.4 (nicolas-grekas)
This PR was merged into the 4.3 branch. Discussion ---------- [Cache] Disable igbinary on PHP >= 7.4 | Q | A | ------------- | --- | Branch? | 4.3 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | - | License | MIT | Doc PR | - Until igbinary/igbinary#244 is fixed. Commits ------- a2c924d [Cache] Disable igbinary on PHP >= 7.4
2 parents d20f544 + a2c924d commit 479efc5
Copy full SHA for 479efc5

File tree

2 files changed

+11
-11
lines changed
Filter options

2 files changed

+11
-11
lines changed

‎src/Symfony/Component/Cache/Marshaller/DefaultMarshaller.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Cache/Marshaller/DefaultMarshaller.php
+4-4Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ class DefaultMarshaller implements MarshallerInterface
2525
public function __construct(bool $useIgbinarySerialize = null)
2626
{
2727
if (null === $useIgbinarySerialize) {
28-
$useIgbinarySerialize = \extension_loaded('igbinary') && \PHP_VERSION_ID !== 70400;
29-
} elseif ($useIgbinarySerialize && (!\extension_loaded('igbinary') || \PHP_VERSION_ID === 70400)) {
30-
throw new CacheException('The "igbinary" PHP extension is not '.(\PHP_VERSION_ID === 70400 ? 'compatible with PHP 7.4.0.' : 'loaded.'));
28+
$useIgbinarySerialize = \extension_loaded('igbinary') && \PHP_VERSION_ID < 70400;
29+
} elseif ($useIgbinarySerialize && (!\extension_loaded('igbinary') || \PHP_VERSION_ID >= 70400)) {
30+
throw new CacheException('The "igbinary" PHP extension is not '.(\PHP_VERSION_ID >= 70400 ? 'compatible with PHP 7.4.' : 'loaded.'));
3131
}
3232
$this->useIgbinarySerialize = $useIgbinarySerialize;
3333
}
@@ -66,7 +66,7 @@ public function unmarshall(string $value)
6666
return null;
6767
}
6868
static $igbinaryNull;
69-
if ($value === ($igbinaryNull ?? $igbinaryNull = \extension_loaded('igbinary') && \PHP_VERSION_ID !== 70400 ? igbinary_serialize(null) : false)) {
69+
if ($value === ($igbinaryNull ?? $igbinaryNull = \extension_loaded('igbinary') && \PHP_VERSION_ID < 70400 ? igbinary_serialize(null) : false)) {
7070
return null;
7171
}
7272
$unserializeCallbackHandler = ini_set('unserialize_callback_func', __CLASS__.'::handleUnserializeCallback');

‎src/Symfony/Component/Cache/Tests/Marshaller/DefaultMarshallerTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Cache/Tests/Marshaller/DefaultMarshallerTest.php
+7-7Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public function testSerialize()
2424
'b' => function () {},
2525
];
2626

27-
$expected = ['a' => \extension_loaded('igbinary') && \PHP_VERSION_ID !== 70400 ? igbinary_serialize(123) : serialize(123)];
27+
$expected = ['a' => \extension_loaded('igbinary') && \PHP_VERSION_ID < 70400 ? igbinary_serialize(123) : serialize(123)];
2828
$this->assertSame($expected, $marshaller->marshall($values, $failed));
2929
$this->assertSame(['b'], $failed);
3030
}
@@ -43,8 +43,8 @@ public function testNativeUnserialize()
4343
*/
4444
public function testIgbinaryUnserialize()
4545
{
46-
if (\PHP_VERSION_ID === 70400) {
47-
$this->markTestSkipped('igbinary is not compatible with PHP 7.4.0.');
46+
if (\PHP_VERSION_ID >= 70400) {
47+
$this->markTestSkipped('igbinary is not compatible with PHP 7.4.');
4848
}
4949

5050
$marshaller = new DefaultMarshaller();
@@ -67,8 +67,8 @@ public function testNativeUnserializeNotFoundClass()
6767
*/
6868
public function testIgbinaryUnserializeNotFoundClass()
6969
{
70-
if (\PHP_VERSION_ID === 70400) {
71-
$this->markTestSkipped('igbinary is not compatible with PHP 7.4.0.');
70+
if (\PHP_VERSION_ID >= 70400) {
71+
$this->markTestSkipped('igbinary is not compatible with PHP 7.4.');
7272
}
7373

7474
$this->expectException('DomainException');
@@ -95,8 +95,8 @@ public function testNativeUnserializeInvalid()
9595
*/
9696
public function testIgbinaryUnserializeInvalid()
9797
{
98-
if (\PHP_VERSION_ID === 70400) {
99-
$this->markTestSkipped('igbinary is not compatible with PHP 7.4.0');
98+
if (\PHP_VERSION_ID >= 70400) {
99+
$this->markTestSkipped('igbinary is not compatible with PHP 7.4.');
100100
}
101101

102102
$this->expectException('DomainException');

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.