# sudo composer require doctrine/instantiator
<?php
require 'vendor/autoload.php';

require_once 'hello.php'; // 如果不存在,将报错

// class hello {
//     public function sayHello() {
//         echo "hello php";
//     }
// }

$instantiator = new \Doctrine\Instantiator\Instantiator();
$instance = $instantiator->instantiate('hello');
$instance->sayHello();

相关文章:

  • 2021-09-20
  • 2022-12-23
  • 2022-02-16
  • 2021-09-09
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-04
猜你喜欢
  • 2021-08-08
  • 2021-09-20
  • 2022-12-23
  • 2022-12-23
  • 2022-02-06
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案