xref: /PHP-7.4/Zend/tests/bug69732.phpt (revision d679f022)
1--TEST--
2Bug #69732 (can induce segmentation fault with basic php code)
3--FILE--
4<?php
5class wpq {
6    private $unreferenced;
7
8    public function __get($name) {
9        return $this->$name . "XXX";
10    }
11}
12
13function ret_assoc() {
14	$x = "XXX";
15    return array('foo' => 'bar', $x);
16}
17
18$wpq = new wpq;
19$wpq->interesting =& ret_assoc();
20$x = $wpq->interesting;
21printf("%s\n", $x);
22--EXPECTF--
23Notice: Undefined property: wpq::$interesting in %sbug69732.php on line 6
24
25Notice: Indirect modification of overloaded property wpq::$interesting has no effect in %sbug69732.php on line 16
26
27Fatal error: Uncaught Error: Cannot assign by reference to overloaded object in %s:%d
28Stack trace:
29#0 {main}
30  thrown in %s on line %d
31