Php namespaces and use

biglad

New Member
I am having a little trouble with namespaces and the use statements.I have three files: path/to/Shape/ShapeInterface.php path/to/Shape/Shape.php and path/to/Shape/Circle.php I am trying to do this using relative paths so I have put this in all of the classes:\[code\]namespace Shape; \[/code\]in my circle class i have the following:\[code\]namespace Shape;//use Shape;//use ShapeInterface;include 'Shape.php';include 'ShapeInterface.php'; class Circle extends Shape implements ShapeInterface{ ....\[/code\]If I use the include statements I get no errors. If I try the use statements I get:\[quote\] Fatal error: Class 'Shape\Shape' not found in /Users/shawn/Documents/work/sites/workspace/shape/Circle.php on line 8\[/quote\]Could someone please give me a little guidance on the issue?Thanks,Shawn
 
Back
Top