开发者

output constructor variable value in oop php

开发者 https://www.devze.com 2023-03-02 19:14 出处:网络
My concept is very poor in o开发者_StackOverflow中文版op for php. My class has a constructor with three parameters.i create a object and pass three values to the constructor. Now, how will i show cons

My concept is very poor in o开发者_StackOverflow中文版op for php. My class has a constructor with three parameters.i create a object and pass three values to the constructor. Now, how will i show constructor value.


class Foo {

public function __constructor($para1, $para2, $para3 ){

   echo $para1 . '<br>';
   echo $para2 . '<br>';
   echo $para3 . '<br>';
}

}

$f = Foo(10,20,30);
0

精彩评论

暂无评论...
验证码 换一张
取 消