Include PHP PHAR without .phar extension
问题 I'm having trouble including a PHAR into my application bootstrapping code. I'm attempting to include the phpunit/phpunit PHAR to have the PHPUnit classes available in my application. Given I have the following directory structure: /path/to/code/ app.php phpunit Where phpunit is the PHPUnit as a PHAR, and app.php contains: <?php $phar = 'phar://' . __DIR__ . '/phpunit'; include $phar; assert(class_exists('\\PHPUnit\\Framework\\TestCase')); I get the following error: PHP Warning: include(phar: