<?php /** * 類的常量必須用雙冒號訪問 * @author Administrator * */ class A { CONST SUCCESS = "a"; } class B extends A { public function __construct() { echo self::SUCCESS; //ok echo parent::SUCCESS; //ok echo SUCCESS; //bad } } new B ();