WordPress.org

Support

Support » Plugins and Hacks » Countdown Timer » [Resolved] [Plugin: Countdown Timer] Fatal error: Cannot redeclare cmp() (previously declared …. gcal-sidebar

[Resolved] [Plugin: Countdown Timer] Fatal error: Cannot redeclare cmp() (previously declared …. gcal-sidebar

  • Hello from France

    I’ve two plugins which use the same cmp() function :

    So when i try to create an event , i get the following message :

    Fatal error: Cannot redeclare cmp() (previously declared in F:\inetpub\vhosts\xxxx.com\httpdocs\ddddd\wp-content\plugins\gcal-sidebar\gcal-sidebar.php:30) in F:\inetpub\vhosts\xxxx.com\httpdocs\ddddd\wp-content\plugins\countdown-timer\fergcorp_countdownTimer.php on line 1022

    In gcal sidebar :

    function cmp($a, $b) {
    if($a[‘startTime’] > $b[‘startTime’])
    return 1;
    if($a[‘startTime’] == $b[‘startTime’])
    return 0;
    if($a[‘startTime’] < $b[‘startTime’])
    return -1;
    }

    In fercop :

    /*Begin sorting events by time*/
    function cmp($adate, $bdate) {
    if($adate < $bdate){
    return -1;
    }else if($adate == $bdate){
    return 0;
    }else{
    return 1;

    Desactivation then activation of the plugin without succes .

    How can i fix this ?

    Many thanks,

    Didier

    http://wordpress.org/extend/plugins/countdown-timer/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hello,

    I’ve changed the name – In gcal sidebar – of the function cmp($a, $b) …
    with :
    function cmpe($a, $b) ,

    and both the plugins work properly .

    Is there a way to check such “identical naming ” evrythere in all the php files ?

    Didier

    Plugin Author fergbrain

    @fergbrain

    This is a bug. For various reasons, I thought this should not happen..but PHP is weird like that. It’s been fixed as of commit 9b65880968 and will be part of the next release. Sorry for the inconvenience 🙁

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Resolved] [Plugin: Countdown Timer] Fatal error: Cannot redeclare cmp() (previously declared …. gcal-sidebar’ is closed to new replies.
Skip to toolbar