1--TEST-- 2SPL: Test class_uses() function : variation - no interfaces and autoload 3--FILE-- 4<?php 5/* Prototype : array class_uses(mixed what [, bool autoload ]) 6 * Description: Return all traits used by a class 7 * Source code: ext/spl/php_spl.c 8 * Alias to functions: 9 */ 10 11echo "*** Testing class_uses() : variation ***\n"; 12 13echo "--- testing no traits ---\n"; 14class fs {} 15var_dump(class_uses(new fs)); 16var_dump(class_uses('fs')); 17 18echo "\n--- testing autoload ---\n"; 19var_dump(class_uses('non_existent')); 20var_dump(class_uses('non_existent2', false)); 21 22 23function __autoload($classname) { 24 echo "attempting to autoload $classname\n"; 25} 26 27?> 28===DONE=== 29--EXPECTF-- 30*** Testing class_uses() : variation *** 31--- testing no traits --- 32array(0) { 33} 34array(0) { 35} 36 37--- testing autoload --- 38attempting to autoload non_existent 39 40Warning: class_uses(): Class non_existent does not exist and could not be loaded in %s on line %d 41bool(false) 42 43Warning: class_uses(): Class non_existent2 does not exist in %s on line %d 44bool(false) 45===DONE=== 46