Load and use classes without namespaces

10 views
Skip to first unread message

Lawrence Lagerlof

unread,
Oct 4, 2019, 1:19:23 PM10/4/19
to composer-users
It's possible to create a package for a class without a namespace, and use it in my scripts like a common class?

eg:

<?php
require_once
'vendor/autoload.php';


$mc
= new MyClass();     // instead of $mc = new Something\MyClass()


This is because I am still using php 5.2. For legacy reasons I can't upgrade php to 5.3 or beyond).


Reply all
Reply to author
Forward
0 new messages