xref: /PHP-8.0/ext/libxml/tests/bug63389.phpt (revision 960318ed)
1--TEST--
2Bug #63389 (Missing context check on libxml_set_streams_context() causes memleak)
3--SKIPIF--
4<?php if (!extension_loaded('libxml')) die('skip libxml extension not available'); ?>
5--FILE--
6<?php
7$fp = fopen("php://input", "r");
8libxml_set_streams_context($fp);
9try {
10    libxml_set_streams_context("a");
11} catch (TypeError $e) {
12    echo $e->getMessage(), "\n";
13}
14echo "okey";
15?>
16--EXPECT--
17libxml_set_streams_context(): Argument #1 ($context) must be of type resource, string given
18okey
19