php const常量 不能使用字符串连接符.链接

class jdpay extends pay {



    const BASE_URL = "https://mapi.jdpay.com/npp10/";
    

    private $agreement_sign_url = self::BASE_URL . "agreement_sign"; //签约请求的url get访问
    private $agreement_cancel_url = self::BASE_URL . "agreement_cancel"; //解约请求
    private $agreement_pay_url = self::BASE_URL . "agreement_pay"; //支付请求
    private $account_query_url = self::BASE_URL . "account_query"; //余额查询请求
}

 这个问题在php5.6以及以上的版本不是问题, 不然会报

syntax error, unexpected '.', expecting ',' or ';' 这样的错误

呵呵,就项目没办法,只能按老办法写了

posted on 2017-03-09 14:41  zh7314  阅读(2126)  评论(0编辑  收藏  举报