1
0
mirror of https://github.com/php/php-src.git synced 2026-04-02 13:43:02 +02:00
Files
archived-php-src/ext/simplexml/tests/bug42369.phpt
Fabien Villepinte a555cc0b3d Clean DONE tags from tests
Remove most of the `===DONE===` tags and its variations.
Keep `===DONE===` if the test output otherwise becomes empty.

Closes GH-4872.
2019-11-07 21:31:47 +01:00

24 lines
561 B
PHP

--TEST--
Bug #42369 (Implicit conversion to string leaks memory)
--SKIPIF--
<?php if (!extension_loaded('simplexml')) echo 'skip simplexml extension is not loaded'; ?>
--FILE--
<?php
$xml = '<?xml version="1.0" encoding="utf-8"?>';
$x = simplexml_load_string($xml . "<q><x>foo</x></q>");
echo 'explicit conversion' . PHP_EOL;
for ($i = 0; $i < 100000; $i++) {
md5(strval($x->x));
}
echo 'no conversion' . PHP_EOL;
for ($i = 0; $i < 100000; $i++) {
md5($x->x);
}
?>
--EXPECT--
explicit conversion
no conversion