I have an Greeting.php with
<?php
namespace sayinghello;
class Greeting {
public function getName() {
return "Hello!";
}
}
and the calls into the sayinghello.php:
<?php
$greeting = new Greeting();
echo $greeting->getName();
When I tried to open the sayinghello.php with my Browser, the Class-Not-Found-Exception would be thrown
('Fatal error: Uncaught Error: Class 'sayinghelloGreeting' not found
in C:UsersUserIdeaProjectsEfPsrcsayinghellosayinghello.php:2
Stack trace: #0 {main} thrown in
C:UsersUserIdeaProjectsEfPsrcsayinghellosayinghello.php on line
2
I use PHP with the XAMPP-Stack and the solutions of similar questions does not solved the problem...
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…