1
0
mirror of https://github.com/php/php-src.git synced 2026-03-27 01:32:22 +01:00
Files
archived-php-src/ext/spl/tests/recursive_tree_iterator_setprefixpart.phpt
Gabriel Caruso ce1d69a1f6 Use int instead of integer in type errors
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".
2018-02-04 19:08:23 +01:00

33 lines
965 B
PHP

--TEST--
SPL: RecursiveTreeIterator::setPrefixPart() Test arguments
--CREDITS--
Roshan Abraham (roshanabrahams@gmail.com)
TestFest London May 2009
--FILE--
<?php
$arr = array(
"a" => array("b")
);
$it = new RecursiveArrayIterator($arr);
$it = new RecursiveTreeIterator($it);
$it->setPrefixPart(1); // Should throw a warning as setPrefixPart expects 2 arguments
$a = new stdClass();
$it->setPrefixPart($a, 1); // Should throw a warning as setPrefixPart expects argument 1 to be long integer
$it->setPrefixPart(1, $a); // Should throw a warning as setPrefixPart expects argument 2 to be a string
?>
===DONE===
--EXPECTF--
Warning: RecursiveTreeIterator::setPrefixPart() expects exactly 2 parameters, 1 given in %s on line %d
Warning: RecursiveTreeIterator::setPrefixPart() expects parameter 1 to be int, object given in %s on line %d
Warning: RecursiveTreeIterator::setPrefixPart() expects parameter 2 to be string, object given in %s on line %d
===DONE===