I am having a little trouble with namespaces and the use
statements.
I have three files: ShapeInterface.php
, Shape.php
and Circle.php
.
I am trying to do this using relative paths so I have put this in all of the classes:
namespace Shape;
In my circle class I have the following:
namespace Shape;
//use Shape;
//use ShapeInterface;
include 'Shape.php';
include 'ShapeInterface.php';
class Circle extends Shape implements ShapeInterface{ ....
If I use the include
statements I get no errors. If I try the use
statements I get:
Fatal error: Class 'ShapeShape' not found in
/Users/shawn/Documents/work/sites/workspace/shape/Circle.php on line 8
Could someone please give me a little guidance on the issue?
Question&Answers:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…