-
[객체지향PHP]5.Static ::(Scope Resolution Operator)서버/PHP 2020. 11. 5. 04:52
Class Person{ private $name public staitc $drinking Age=21; }
불러올 때는
<?php Person::$drinkingAge ?>
::(Scope Resolution Operator)
클래스 내에서 메서드로 불러 올 때는
public static function setDrinkingAge($newDA) { self ::$drinkingAge; }
self ::
부모 클래스에서 불러 올 때는
parent::
::(Scope Resolution Operator)
는 const 변수에도 똑같이 사용된다.
'서버 > PHP' 카테고리의 다른 글
[객체지향PHP]7.Namespace (0) 2020.11.05 [객체지향PHP]6.include (0) 2020.11.05 [객체지향PHP]4.객체 지우기 (0) 2020.11.05 [객체지향PHP]3.생성자 (0) 2020.11.05 [객체지향PHP]2.메서드와 상속 (0) 2020.11.05