javascript与php观察者模式
                                            - JAVASCRIPT:
 a. 代码:var a = function(){ this.int = 0 this.add = function(int){ this.int = int } this.watch = function(){ if(this.int==0){ console.log('0') }else{ console.log('not 0') } } } var a = new a() a.watch() a.add(1) a.watch()b. 输出:  成都创新互联公司-专业网站定制、快速模板网站建设、高性价比扎赉诺尔网站开发、企业建站全套包干低至880元,成熟完善的模板库,直接使用。一站式扎赉诺尔网站制作公司更省心,省钱,快速模板网站建设找我们,业务覆盖扎赉诺尔地区。费用合理售后完善,十余年实体公司更值得信赖。 0 not 0
- PHP:
 a. 代码:int += $int; } public function watch(){ if($this->int==0){ echo "0".PHP_EOL; }else{ echo "not 0".PHP_EOL; } } } $a = new a(); $a->watch(); $a->add(1); $a->watch();b. 输出: 0 not 0
分享标题:javascript与php观察者模式
网页地址:http://www.scyingshan.cn/article/jppddp.html

 建站
建站
 咨询
咨询 售后
售后
 建站咨询
建站咨询 
 