In PHP, I wish to import 2 third-party classes, which have the same name. For example:
// in file libs/3rdparty/AppleTree/Apple.php
class Apple extends SomeOtherModel {
// class details
}
// in file libs/3rdparty/AppleSeed/Apple.php
class Apple extends SomeModel {
// class details
}
Given that their constructor is the same, e.g.:
$appletree = new Apple();
$appleseed = new Apple();
How can PHP differentiate the two classes? In Java, we can append the class path before the constructor.
Note: I'm using PHP 5 & I can't modify the classes as they are used by other class files.