1--TEST--
2Exception in compound assign op should prevent call to overloaded object handlers
3--FILE--
4<?php
5
6#[AllowDynamicProperties]
7class Test {
8    public function __get($k) {
9        $this->$k = 42;
10        return 0;
11    }
12}
13
14$test = new ArrayObject;
15$test[0] = 42;
16try {
17    $test[0] %= 0;
18} catch (Error $e) {
19    echo $e->getMessage(), "\n";
20}
21var_dump($test);
22
23$test2 = new Test;
24try {
25    $test2->prop %= 0;
26} catch (Error $e) {
27    echo $e->getMessage(), "\n";
28}
29var_dump($test2);
30
31?>
32--EXPECT--
33Modulo by zero
34object(ArrayObject)#1 (1) {
35  ["storage":"ArrayObject":private]=>
36  array(1) {
37    [0]=>
38    int(42)
39  }
40}
41Modulo by zero
42object(Test)#3 (1) {
43  ["prop"]=>
44  int(42)
45}
46