1
0
mirror of https://github.com/php/php-src.git synced 2026-04-19 14:01:01 +02:00
Files
archived-php-src/ext/standard/tests/file/fstat_variation2.phpt
Gabriel Caruso fef879a2d6 Use bool instead of boolean while throwing a type error
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.
2018-02-04 23:09:40 +01:00

31 lines
722 B
PHP

--TEST--
Test function fstat() by substituting argument 1 with boolean values.
--FILE--
<?php
$variation_array = array(
'lowercase true' => true,
'lowercase false' =>false,
'uppercase TRUE' =>TRUE,
'uppercase FALSE' =>FALSE,
);
foreach ( $variation_array as $var ) {
var_dump(fstat( $var ) );
}
?>
===DONE===
--EXPECTF--
Warning: fstat() expects parameter 1 to be resource, bool given in %s on line %d
bool(false)
Warning: fstat() expects parameter 1 to be resource, bool given in %s on line %d
bool(false)
Warning: fstat() expects parameter 1 to be resource, bool given in %s on line %d
bool(false)
Warning: fstat() expects parameter 1 to be resource, bool given in %s on line %d
bool(false)
===DONE===