mirror of
https://github.com/php/php-src.git
synced 2025-08-17 22:48:57 +02:00

PHP requires integer typehints to be written "int" and does not allow "integer" as an alias. This changes type error messages to match the actual type name and avoids confusing messages like "must be of the type integer, integer given".
49 lines
1.3 KiB
PHP
49 lines
1.3 KiB
PHP
--TEST--
|
|
ReflectionObject::__construct - invalid arguments
|
|
--FILE--
|
|
<?php
|
|
|
|
var_dump(new ReflectionObject());
|
|
var_dump(new ReflectionObject('stdClass'));
|
|
$myInstance = new stdClass;
|
|
var_dump(new ReflectionObject($myInstance, $myInstance));
|
|
var_dump(new ReflectionObject(0));
|
|
var_dump(new ReflectionObject(null));
|
|
var_dump(new ReflectionObject(array(1,2)));
|
|
?>
|
|
--EXPECTF--
|
|
Warning: ReflectionObject::__construct() expects exactly 1 parameter, 0 given in %s on line 3
|
|
object(ReflectionObject)#%d (1) {
|
|
["name"]=>
|
|
string(0) ""
|
|
}
|
|
|
|
Warning: ReflectionObject::__construct() expects parameter 1 to be object, string given in %s on line 4
|
|
object(ReflectionObject)#%d (1) {
|
|
["name"]=>
|
|
string(0) ""
|
|
}
|
|
|
|
Warning: ReflectionObject::__construct() expects exactly 1 parameter, 2 given in %s on line 6
|
|
object(ReflectionObject)#%d (1) {
|
|
["name"]=>
|
|
string(0) ""
|
|
}
|
|
|
|
Warning: ReflectionObject::__construct() expects parameter 1 to be object, int given in %s on line 7
|
|
object(ReflectionObject)#%d (1) {
|
|
["name"]=>
|
|
string(0) ""
|
|
}
|
|
|
|
Warning: ReflectionObject::__construct() expects parameter 1 to be object, null given in %s on line 8
|
|
object(ReflectionObject)#%d (1) {
|
|
["name"]=>
|
|
string(0) ""
|
|
}
|
|
|
|
Warning: ReflectionObject::__construct() expects parameter 1 to be object, array given in %s on line 9
|
|
object(ReflectionObject)#%d (1) {
|
|
["name"]=>
|
|
string(0) ""
|
|
}
|