So I need to include modular code/libraries in my project, a new library:
Library A:
a.php: class A;
Library B: (with v1.0 checked out from A)
b.php: include_once a.php; class B extends A;
Library C: (with v2.0 checked out from A)
c.php: include_once a.php; class C extends A;
Library D:
d.php: include_once b.php,c.php;
This obviously leads to name conflict (cannot redeclare A
).
I cannot touch either of the libraries as they are frequently pulled from elsewhere. Also, I need the result to be another library, so nested namespaces is not an option. But I guess there must be plenty of other projects with the same problem?? Thanks for any suggestions.