以前习惯了美工和前端开发,现在进阶后端,开始学习PHP,在学习类的时候,碰到了一个私有方法调用的问题. 代码如下: <?php class Person { public function say($name, $age) { $con = $this->get($name, $age); //这里的$this->是关键 echo "my name is :".$name."<br />"; echo "my age is :…
1.定义类 public class Student { public int ID { get; set; } public string Name { get; set; } //[XmlIgnore] public Student StudentInfo { get; set; } } 2.执行序列化操作,如果内部对象引用自己,xml序列化抛出异常“检测到循环引用” Student stu = new Student(); stu.ID = ; stu.Name = "张三";…