1--TEST--
2EX(func) can be null during write_property in an edge case
3--FILE--
4<?php
5class a {
6    public static $i = 0;
7    function __destruct() {
8        if (self::$i++ != 0) throw new Exception;
9        $b = new a;
10        echo $b;
11    }
12}
13new a;
14?>
15--EXPECTF--
16Fatal error: Uncaught Error: Object of class a could not be converted to string in %s:%d
17Stack trace:
18#0 %s(%d): a->__destruct()
19#1 {main}
20
21Next Exception in %s:%d
22Stack trace:
23#0 %s(%d): a->__destruct()
24#1 {main}
25  thrown in %s on line %d
26