1--TEST-- 2Test get_declared_classes() function : basic functionality 3--FILE-- 4<?php 5echo "*** Testing get_declared_classes() : basic functionality ***\n"; 6 7// Zero arguments 8echo "\n-- Testing get_declared_classes() function with Zero arguments --\n"; 9var_dump(get_declared_classes()); 10 11foreach (get_declared_classes() as $class) { 12 if (!class_exists($class)) { 13 echo "Error: $class is not a valid class.\n"; 14 } 15} 16 17echo "\n-- Ensure userspace classes are listed --\n"; 18Class C {} 19var_dump(in_array('C', get_declared_classes())); 20 21echo "\n-- Ensure userspace interfaces are not listed --\n"; 22Interface I {} 23var_dump(in_array( 'I', get_declared_classes())); 24 25echo "Done"; 26?> 27--EXPECTF-- 28*** Testing get_declared_classes() : basic functionality *** 29 30-- Testing get_declared_classes() function with Zero arguments -- 31array(%d) { 32%a 33} 34 35-- Ensure userspace classes are listed -- 36bool(true) 37 38-- Ensure userspace interfaces are not listed -- 39bool(false) 40Done 41