<?php
class ss{
public static $code;
public function __construct( $code )
{
self::$code=$code; //这里已经使用了this指针
}
public static function app() {
self::$code=new s1(2);
return self::$code;
}
}
class s1{
public $s2;
public function __construct( $code )
{
$this->s2 = $code; //这里已经使用了this指针
}
}
$ss=new ss(new s1(false));
$ss::app()->s2=true;
var_dump($ss::$code->s2);
?>

经过测试,self面向当前类,可以操作static变量,$this面向当前对象,操作常量。

最新文章

  1. Linux网络编程(简单的时间获取服务器)
  2. [Leetcode] Palindrome Partitioning
  3. Bootstrap系列 -- 33. 等分按钮
  4. Android ListView快速定位(四)
  5. tp中调用PHP系统扩展类
  6. EventBus 事件总线 原理
  7. ubuntu中在线升级python
  8. Robots协议
  9. ambari下 hive metastore 启动失败
  10. JavaScript 题目(作用域)
  11. 「【算法进阶0x30】数学知识A」作业简洁总结
  12. Hadoop-Impala学习笔记之SQL参考
  13. Spring中使用RedisTemplate操作Redis(spring-data-redis)
  14. 清理messages提示-bash: /var/log/messages: Operation not permitted的处理
  15. Flex学习笔记-皮肤
  16. Jquery 给Js动态新添加的元素 绑定的点击事件
  17. python logging 日志
  18. android即时消息处理机制
  19. mysql5.6搭建主从复制
  20. 1.Android JUnit Runner(使用AndroidStudio)

热门文章

  1. 神经网络图灵机(Neural Turing Machines, NTM)
  2. [luogu4728 HNOI2009] 双递增序列 (dp)
  3. bytes类型和python中编码的转换方法
  4. Python - 三大器 迭代器,生层器,装饰器
  5. 【Codeforces 158B】Taxi
  6. Git学习总结(13)——使用git.oschina作为自己的源代码在线管理库
  7. Linux下几种文件传输命令
  8. fzu 2122
  9. [Poj2112][USACO2003 US OPEN] Optimal Milking [网络流,最大流][Dinic+当前弧优化]
  10. P1331 海战 洛谷