Cannot access empty property
致命错误:不能够进入此空值,位于E:\sunlion\web\down\class\db_sql.php
代码
<?php
Class TestClass1{
var $class2;
public function TestClass1(){
$this-> $class2 = new TestClass2();
}
}
Class TestClass2{
var $aaaa="1111111";
}
$ccc = new TestClass1();
echo $ccc-> $class2-> $aaaa;
?>
错误的地方:
$this-> $class2 = new TestClass2();
改为$this-> class2 = new TestClass2();
$this-> 后的变量不带$符
Cannot access empty property的更多相关文章
- php加密解密功能类
这两天突发奇想想要用php写一个对日常项目加密以及解密的功能,经过努力简单的封装了一个对php代码进行加密解密的类,一些思想也是来自于网络,初步测试用着还行,可以实现对指定项目的加密以及解密(只针对本 ...
- JavaPersistenceWithHibernate第二版笔记-第五章-Mapping value types-001Mapping basic properties(@Basic、@Access、access="noop"、@Formula、@ColumnTransformer、@Generated、 @ColumnDefaul、@Temporal、@Enumerated)
一.简介 在JPA中,默认所有属性都会persist,属性要属于以下3种情况,Hibernate在启动时会报错 1.java基本类型或包装类 2.有注解 @Embedded 3.有实现java.io. ...
- Hibernate逍遥游记-第3章对象-关系映射基础-access="field"、dynamic-insert、dynamic-update、formula、update=false
1. package mypack; import java.util.*; public class Monkey{ private Long id; private String firstnam ...
- [Angular 2] Template property syntax
This lesson covers using the [input] syntax to change an element property such as “hidden” or “conte ...
- [SoapUI] Property Expansion in soapUI
1. Property Expansion in soapUI SoapUI provides a common syntax to dynamically insert ("expand& ...
- Fluent Python: @property
Fluent Python 9.6节讲到hashable Class, 为了使Vector2d类可散列,有以下条件: (1)实现__hash__方法 (2)实现__eq__方法 (3)让Vector2 ...
- 一文了解python的 @property
参考自: https://www.programiz.com/python-programming/property Python为我们提供了一个内置装饰器@property,此方法使得getter和 ...
- 看懂mysql执行计划--官方文档
原文地址:https://dev.mysql.com/doc/refman/5.7/en/explain-output.html 9.8.2 EXPLAIN Output Format The EXP ...
- Yii的学习(5)--Active Record的关联
官网原文:http://www.yiiframework.com/doc/guide/1.1/zh_cn/database.arr 官网中后半段为英文,而且中文的内容比英文少一些,先放到这里,之后有时 ...
随机推荐
- linux系统关机与重新启动命令
在linux下关机和重新启动系统有shutdown.halt.reboot.init,对于他们来说他们的内部工作过程是不同样的. 1.shutdown命令 使用它能够安全地关闭系统.然而在关闭系统时. ...
- 【LeetCode】 Populating Next Right Pointers in Each Node 全然二叉树
题目:Populating Next Right Pointers in Each Node <span style="font-size:18px;">/* * Le ...
- 【MFC学习笔记-作业7-小型画图软件】【】
作业要求: 按下鼠标右键画圆. 按下鼠标左键移动曲线. 丝毫没有思路..网上教程又比这个程序复杂100倍... 好吧 总算找到一个合适的了... 转载至:http://blog.chinaunix.n ...
- codeblocks 使用指南z
1.界面风格更改 首先贴怎么普通设置出来,或者改配置文件 这是我的风格 类似于DEV-CPP里面的一个主题,看的很舒服 具体设置如下: Settings-Editor 1.代码当前行高亮 在Gener ...
- LeetCode Day5——House Robber
问题描述: 意思就是说:给定一个数组,寻找一种选取方法,使得在保证任何两个相邻元素不同时被选的条件下得到的数值总和最大. 1. 递归 设nums为数组首地址,numsSize为数组的大小,max[i] ...
- win7充分利用cpu来提供计算机性能
在任务栏左下角点击开始菜单,在运行框内输入msconfig,在弹出的窗口点击“高级选项”,接着会弹出一个新窗口,我们勾选“处理器数”,在下拉菜单中按照自己的电脑配置进行选择,现在双核比较常见,当然也有 ...
- offset
document.body.clientWidth ==> BODY对象宽度 document.body.clientHeight ==> BODY对象高度 document.docume ...
- css3文本效果
CSS3 包含多个新的文本特性. 在本章中,您将学到如下文本属性: 1. text-shadow 2. word-wrap 浏览器支持 Internet Explorer 10.Firefox.Chr ...
- css层叠机制说明
css通过建立与文档的关联而实施效果.文档结构重要性不言而喻,对于建立良好的内容索引.提高可维护性.较好的可访问性:另,利于css选择器选择.继承机制. 概要地讲,层叠机制是处理对文档上应用样式时解决 ...
- file_get_contents()的另一种使用方法
今天在网上看到一篇挺不错的文章,拿过来保存学习一下.本文源地址为:http://www.kuitao8.com/20140727/2867.shtml $data = file_get_content ...