3.14;
}
echo Math::pi . '<br/>';
</code>
==== 정적(static) 메소드 ====
static 을 붙이면 인스턴스를 만들지 않아도 호출이 가능하다.
<code php>
class Math {
static function squared( $input ) {
return $input * $i... 된다. php v5.3 부터 적용.
<code php>
class A {
public static function who() { echo __CLASS__; }
public static