1--TEST--
2XMLWriter::toMemory() - custom constructor error
3--EXTENSIONS--
4xmlwriter
5--FILE--
6<?php
7
8class CustomXMLWriter extends XMLWriter {
9    public function __construct() {
10        throw new Error('nope');
11    }
12}
13
14try {
15    CustomXMLWriter::toMemory();
16} catch (Throwable $e) {
17    echo $e->getMessage(), "\n";
18}
19
20?>
21--EXPECT--
22nope
23