PHP Underscores vs. Directory separators

Forgive my ignorance on this, but when I run composer to install magium examples, i notice many of the class names have underscores, e.g. PHPUnit_Framework_Test, but when I look in the autoload_static.php i see :
        'PHPUnit\\Framework\\Test' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Test.php',

Open in new window

and the files are not loading properly. Is this some setting I haven't set?
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Ray PaseurCommented:
There must be a little more to the code, right?  By itself, that looks like a parse error.

I think the backslashes\\ are related to PHP namespaces.  The underscores__ are part of the magic constant's name.  Underscores are legit characters in PHP variable and constant names.
Silas2Author Commented:
Thanks Ray, I just did a hack on the classloader.php to find the files, and now I'm getting a brick wall on
" implements \PHPUnit_Framework_TestListener"
Its not using the classloader.php to look for it....
Silas2Author Commented:
Generally speaking, I've downloaded a test project with loads of dependencies, and I see some pointing to AppData\Local\Temp\$Metadata$\B49847A5$phpunit-4.5.phar/PHPUnit_Framework_TestCase.php (which i didn't knowingly download) and I see references broken there....I'm sure this the php version of 'DLL Hell', I was hoping the composer would take care of this stuff..
Silas2Author Commented:
Whats' the best way out of this ?
Ray PaseurCommented:
The best way out may be to start over with a clean install of your dependencies.  When I take on a new framework or any other complicated activity, especially when I'm going into unfamiliar territory, I like to use Bitnami stacks.  You can download a free VM, spin it up, hack away at it, and if things go wrong, just dump it and start over.

Implements is a term of art in PHP object-oriented design.  When you see the implements keyword, you know that the next thing is the name of the interface or interfaces.  You can consult the design of these interfaces to see what code you need to write in a class that implements the interface.  Contrast abstract classes, where part of the class is already built.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.