]> granicus.if.org Git - php/commitdiff
test for bug #78151
authorJoe Watkins <krakjoe@php.net>
Wed, 12 Jun 2019 20:39:00 +0000 (22:39 +0200)
committerJoe Watkins <krakjoe@php.net>
Wed, 12 Jun 2019 20:39:00 +0000 (22:39 +0200)
Zend/tests/bug78151.phpt [new file with mode: 0644]

diff --git a/Zend/tests/bug78151.phpt b/Zend/tests/bug78151.phpt
new file mode 100644 (file)
index 0000000..87b98a4
--- /dev/null
@@ -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"