当创建一个新副本($p2)时,新对象($p2)的中所保存的引用指向的是$p1所引用的同一个$account对象.
如果不想对象属性在被复制之后被共享,可以显式地在__clone方法中复制指向的对象
http://www.bkjia.com/phpjc/745143.htmlwww.bkjia.comtruehttp://www.bkjia.com/phpjc/745143.htmltecharticle__construct( -balance= __construct( , , -name= -age= -account= setid( -id= -id=0 = person('tom', 33, account(200 -setid(4 = -account-balance+=500 -account-balance; 当创建一个新...