<?php
class Math{
const pi=3.1415926;//常量
public function test(){
echo Math::pi;//调用类自身的常量
}
}
$m=new Math();
$m->test();
?>
调用类自身常量
最新推荐文章于 2021-03-10 00:37:35 发布
<?php
class Math{
const pi=3.1415926;//常量
public function test(){
echo Math::pi;//调用类自身的常量
}
}
$m=new Math();
$m->test();
?>