[thelist] PHP "cannot redeclare" function

Barney Carroll barney at clickwork.net
Thu Apr 9 08:20:55 CDT 2009

Hey folks, slowly building myself a little PHP framework to simplify site
building/management. It's a very fun experience, and I'm learning all the
time. However I just got stumped when I received this as output after
writing myself a really basic function:

*Fatal error*: Cannot redeclare httpref() (previously declared in
E:\domains\a\antonio\user\htdocs\data.php:11) in *
E:\domains\a\antonio\user\htdocs\data.php* on line *13*

Lines 11 to 13 of data.php are as follows:

  function httpref($url){
    return stristr($url, "\htdocs");

There is nothing else anywhere by the name of httpref. I can't see how this
ultrabasic function can conflict with itself. Is this the server's
roundabout way of telling me I can't write functions?

Barney Carroll
Web designer & front-end developer

web: www.clickwork.net

mobile: +44 (0) 7594 506 381
home: +44 (0) 118 975 0020

twitter: @barneycarroll

More information about the thelist mailing list