pthread 不继承定义器和包含文件

pthread not to inherit definer and includes file

pthread 运行 方法中是否有无法继承包含文件和定义变量的可能性?我试过 PTHREADS_INHERIT_NONE 但似乎 不工作。我们使用了下面的代码。

$domain_root='/home/user/abc';
define('DIR_FS_DOMAIN_ROOT', $domain_root);
class NEWThread extends Thread{
    public function __construct()
    {

   }
    public function run()
    {
         $this->html=DIR_FS_DOMAIN_ROOT;
    }
}
$th=new NEWThread(PTHREADS_INHERIT_NONE);
$th->start();
$th->join();
echo $th->html;

在错误的地方使用了PTHREADS_INHERIT_NONE。它应该与启动方法一起使用。

$domain_root='/home/user/abc';
define('DIR_FS_DOMAIN_ROOT', $domain_root);
class NEWThread extends Thread{
   public function __construct(){
   }
  public function run(){
     $this->html=DIR_FS_DOMAIN_ROOT;
  }
}
$th=new NEWThread();
$th->start(PTHREADS_INHERIT_NONE);
$th->join();
echo $th->html;