1
我在用Ratth和Ratth運行到我對命名空間不瞭解的地方。我已經添加了新的文件,我的應用程序:找不到'MyApp Thread'類
<?php
namespace MyApp;
class Test1 extends Thread
{
public function run()
{
for ($i = 0; $i < 2; $i++) {
sleep(10);
echo 1 . date(' H:i:s') . "\n";
}
}
}
但我搞砸了一些與命名空間,因爲我得到這個錯誤:
PHP Fatal error: Class 'MyApp\Thread' not found in /home/idea/CLI/src/MyApp/Test1.php on line 4
Fatal error: Class 'MyApp\Thread' not found in /home/idea/CLI/src/MyApp/Test1.php on line 4
爲什麼PHP找不到Thread類?它在棘輪之外工作得很好。
你能否包括你的文件夾結構。 – Beginner
但是Thread類來自pthreads,它不在我的項目中。 –