summaryrefslogtreecommitdiff
path: root/Zend/tests/bug76667.phpt
blob: 03bd490a04090ce2794776ca25a26e4350db737a (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
--TEST--
Bug #76667 (Segfault with divide-assign op and __get + __set)
--FILE--
<?php

class T {
    public function __get($k)
    {
        return $undefined->$k;
    }

    public function __set($k, $v)
    {
        return $this->$v /= 0;
    }
}

$x = new T;
try {
    $x->x = 1;
} catch (\DivisionByZeroError $e) {
    echo $e->getMessage() . \PHP_EOL;
}
?>
--EXPECTF--
Warning: Undefined variable $undefined in %s on line %d

Warning: Attempt to read property "1" on null in %s on line %d
Division by zero