PHP validates classes that use methods for attributes and local variables

From , 5 Years ago, written in PHP, viewed 84 times.
URL https://pastebin.vip/view/89d4402d
  1. <!-- 验证属性和局部变量使用方法的类 -->
  2. <?
  3. class A{
  4.         private $a = 99;
  5.     //这里写一个打印参数的方法.
  6.         public function printInt($a){
  7.                 echo "这里的 \$a 是传递的参数 $a ";
  8.                 echo "<br>";
  9.                 echo "这里的 \$this->a 是属性 $this->a";
  10.         }
  11. }
  12. $a = new A(); // 这里的$a 可不是类中的任何一个变量了.
  13. $a->printInt(88);
  14. ?>
  15.  

Reply to "PHP validates classes that use methods for attributes and local variables"

Here you can reply to the paste above

captcha

https://burned.cc - Burn After Reading Website