Guest User

Untitled

a guest
Jul 17th, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.42 KB | None | 0 0
  1. <?
  2. class test {
  3. protected static $var = 'hello';
  4.  
  5. public function test2() {
  6. if(empty($this->var)) {
  7. echo 'this empty<BR>';
  8. }
  9. else {
  10. echo 'this populated<BR>';
  11. }
  12. if(empty(self::$var)) {
  13. echo 'self empty<BR>';
  14. }
  15. else {
  16. echo 'self populated<BR>';
  17. }
  18. }
  19.  
  20. public static function test1() {
  21. echo "this not avail.<bR>";
  22. if(empty(self::$var)) {
  23. echo 'self empty<BR>';
  24. }
  25. else {
  26. echo 'self populated<BR>';
  27. }
  28. }
  29. }
  30.  
  31. test::test1();
  32. $temp = new test();
  33. $temp->test2();
Add Comment
Please, Sign In to add comment