summaryrefslogtreecommitdiffstats
path: root/12845d5957b8af7c356e31f0d1be3d72986aab26.patch
blob: a01267d700982a279600980a1abf40ccb5c3443d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
From 12845d5957b8af7c356e31f0d1be3d72986aab26 Mon Sep 17 00:00:00 2001
From: Nikita Popov <nikita.ppv@gmail.com>
Date: Sat, 15 Feb 2020 11:09:22 +0100
Subject: [PATCH] Fork test for PHP 8

---
 tests/apc_store_reference.phpt      |  2 ++
 tests/apc_store_reference_php8.phpt | 26 ++++++++++++++++++++++++++
 2 files changed, 28 insertions(+)
 create mode 100644 tests/apc_store_reference_php8.phpt

diff --git a/tests/apc_store_reference.phpt b/tests/apc_store_reference.phpt
index 2228899..d2cb991 100644
--- a/tests/apc_store_reference.phpt
+++ b/tests/apc_store_reference.phpt
@@ -4,6 +4,8 @@ The outermost value should always be a value, not a reference
 apc.enabled=1
 apc.enable_cli=1
 apc.serializer=default
+--SKIPIF--
+<?php if (PHP_VERSION_ID >= 80000) die('skip Requires PHP < 8.0.0'); ?>
 --FILE--
 <?php
 
diff --git a/tests/apc_store_reference_php8.phpt b/tests/apc_store_reference_php8.phpt
new file mode 100644
index 0000000..1eae4bb
--- /dev/null
+++ b/tests/apc_store_reference_php8.phpt
@@ -0,0 +1,26 @@
+--TEST--
+The outermost value should always be a value, not a reference
+--INI--
+apc.enabled=1
+apc.enable_cli=1
+apc.serializer=default
+--SKIPIF--
+<?php if (PHP_VERSION_ID < 80000) die('skip Requires PHP >= 8.0.0'); ?>
+--FILE--
+<?php
+
+/* The output is different for the php serializer, because it does not replicate the
+ * cycle involving the top-level value. Instead the cycle is placed one level lower.
+ * I believe this is a bug in the php serializer. */
+
+$value = [&$value];
+apcu_store(["key" => &$value]);
+$result = apcu_fetch("key");
+var_dump($result);
+
+?>
+--EXPECT--
+array(1) {
+  [0]=>
+  *RECURSION*
+}