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 ';' 这样的错误

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


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM