1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00
Files
archived-php-src/ext/spl/tests/class_uses_variation.phpt
2020-06-24 13:13:44 +02:00

37 lines
845 B
PHP

--TEST--
SPL: Test class_uses() function : variation - no interfaces and autoload
--FILE--
<?php
echo "*** Testing class_uses() : variation ***\n";
echo "--- testing no traits ---\n";
class fs {}
var_dump(class_uses(new fs));
var_dump(class_uses('fs'));
spl_autoload_register(function ($classname) {
echo "attempting to autoload $classname\n";
});
echo "\n--- testing autoload ---\n";
var_dump(class_uses('non_existent'));
var_dump(class_uses('non_existent2', false));
?>
--EXPECTF--
*** Testing class_uses() : variation ***
--- testing no traits ---
array(0) {
}
array(0) {
}
--- testing autoload ---
attempting to autoload non_existent
Warning: class_uses(): Class non_existent does not exist and could not be loaded in %s on line %d
bool(false)
Warning: class_uses(): Class non_existent2 does not exist in %s on line %d
bool(false)