summaryrefslogtreecommitdiffstats
path: root/b2b0e5246650bc6b63e841614110e471a061d577.patch
blob: 2ab8bcdc69d885aaa9fa6c3ae237ecd03e2a27e4 (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
From b2b0e5246650bc6b63e841614110e471a061d577 Mon Sep 17 00:00:00 2001
From: Joe Watkins <krakjoe@php.net>
Date: Wed, 12 Jun 2019 22:39:00 +0200
Subject: [PATCH] test for bug #78151

---
 Zend/tests/bug78151.phpt | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)
 create mode 100644 Zend/tests/bug78151.phpt

diff --git a/Zend/tests/bug78151.phpt b/Zend/tests/bug78151.phpt
new file mode 100644
index 000000000000..87b98a4e44aa
--- /dev/null
+++ b/Zend/tests/bug78151.phpt
@@ -0,0 +1,23 @@
+--TEST--
+Bug #78151 Segfault caused by indirect expressions in PHP 7.4a1
+--FILE--
+<?php
+
+class Arr
+{
+    private $foo = '';
+
+    public function __construct(array $array = [])
+    {
+        $property = 'foo';
+
+        $this->{$property} = &$array[$property];
+
+        \var_dump($this->foo);
+    }
+}
+
+$arr = new Arr(['foo' => 'bar']);
+?>
+--EXPECT--
+string(3) "bar"