mirror of
https://github.com/php/php-src.git
synced 2026-03-24 00:02:20 +01:00
The resource check makes no sense, and the is_array() check doesn't achieve anything. Drop the former, and replace the latter with a ! check. Discovered while working on GH-18729. Closes GH-18731.
25 lines
408 B
PHP
25 lines
408 B
PHP
--TEST--
|
|
invalid object raise exception() function
|
|
--EXTENSIONS--
|
|
enchant
|
|
--FILE--
|
|
<?php
|
|
$broker = enchant_broker_init();
|
|
if (is_object($broker)) {
|
|
echo "OK\n";
|
|
@enchant_broker_free($broker);
|
|
try {
|
|
@enchant_broker_free($broker);
|
|
} catch (ValueError $e) {
|
|
echo $e->getMessage()."\n";
|
|
}
|
|
} else {
|
|
exit("init failed\n");
|
|
}
|
|
echo "OK\n";
|
|
?>
|
|
--EXPECT--
|
|
OK
|
|
Invalid or uninitialized EnchantBroker object
|
|
OK
|