While trying to learn how to use the PHP ReflectionClass, I run into this problem Fatal error: Uncaught ReflectionException: Class \DatabaseTable does not exist in C:\xampp\htdocs\img\index.php:5 Stack trace: #0 C:\xampp\htdocs\img\index.php(5): ReflectionClass->__construct('\DatabaseTable') #1 {main} thrown in C:\xampp\htdocs\img\index.php on line 5.
Meanwhile (just for testing purposes), index.php, classInfo.php and DatabaseTable.php are all in the same folder.
This is the index.php file
<?php
require 'classInfo.php';
require 'DatabaseTable.php';
$class = new ReflectionClass('\\DatabaseTable');
echo classInfo::getData($class);
?>
The classInfo.php class has just a single method and it is static.
Aucun commentaire:
Enregistrer un commentaire