mirror of
https://github.com/php/php-src.git
synced 2024-09-23 10:57:26 +00:00
fef879a2d6
PHP requires boolean typehints to be written "bool" and disallows
"boolean" as an alias. This changes the error messages to match
the actual type name and avoids confusing messages like "must be
of type boolean, boolean given".
This a followup to ce1d69a1f6
, which
implements the same change for integer->int.
44 lines
1.1 KiB
PHP
44 lines
1.1 KiB
PHP
--TEST--
|
|
Check that SplObjectStorage::addAll generate a warning and returns NULL when passed non-object param
|
|
--CREDITS--
|
|
PHPNW Testfest 2009 - Simon Westcott (swestcott@gmail.com)
|
|
--FILE--
|
|
<?php
|
|
|
|
$data_provider = array(
|
|
array(),
|
|
true,
|
|
"string",
|
|
12345,
|
|
1.2345,
|
|
NULL
|
|
);
|
|
|
|
foreach($data_provider as $input) {
|
|
|
|
$s = new SplObjectStorage();
|
|
|
|
var_dump($s->addAll($input));
|
|
}
|
|
|
|
?>
|
|
--EXPECTF--
|
|
Warning: SplObjectStorage::addAll() expects parameter 1 to be SplObjectStorage, array given in %s on line %d
|
|
NULL
|
|
|
|
Warning: SplObjectStorage::addAll() expects parameter 1 to be SplObjectStorage, bool given in %s on line %d
|
|
NULL
|
|
|
|
Warning: SplObjectStorage::addAll() expects parameter 1 to be SplObjectStorage, string given in %s on line %d
|
|
NULL
|
|
|
|
Warning: SplObjectStorage::addAll() expects parameter 1 to be SplObjectStorage, int given in %s on line %d
|
|
NULL
|
|
|
|
Warning: SplObjectStorage::addAll() expects parameter 1 to be SplObjectStorage, float given in %s on line %d
|
|
NULL
|
|
|
|
Warning: SplObjectStorage::addAll() expects parameter 1 to be SplObjectStorage, null given in %s on line %d
|
|
NULL
|
|
|