[PHP]Static Modifier

개발관련/PHP 2012. 4. 20. 15:37 |
total_students;
echo Student::$total_students ."
"; echo Student::welcome_students() ."
"; echo Student::welcome_students("Greetings") ."
"; Student::$total_students = 1; echo Student::$total_students ."
"; // static variables are shared throughout the inheritance tree. class One { static $foo; } class Two extends One { } class Three extends One { } One::$foo = 1; Two::$foo = 2; Three::$foo = 3; echo One::$foo; // 3 echo Two::$foo; // 3 echo Three::$foo; // 3 ?>
0
Hello students.
Greetings students.
1
333 


'개발관련 > PHP' 카테고리의 다른 글

[PHP]Template Replace (Object Oriented)  (0) 2012.04.20
[PHP]Template Replace  (0) 2012.04.20
[PHP]Server Variables  (0) 2012.04.20
[PHP]Sendemail 2 (phpmailer 사용)  (0) 2012.04.20
[PHP]Sendemail  (0) 2012.04.20
Posted by 파노카페
: