diff options
author | Kyle Kaminski <kyle@xenomedia.com> | 2014-04-10 00:36:37 -0500 |
---|---|---|
committer | Kyle Kaminski <kyle@xenomedia.com> | 2014-04-10 00:36:37 -0500 |
commit | 5bc445bd93153f26bc520ba6ca91a86bbc8a5804 (patch) | |
tree | fc4f42a4d15f7bcf5b73a4b219f84321b6fb6036 /oo/blank_object.php | |
parent | 02e716a67dd0e6987e732232ea48bc73f62eeb97 (diff) | |
download | phpsandbox-5bc445bd93153f26bc520ba6ca91a86bbc8a5804.tar.gz phpsandbox-5bc445bd93153f26bc520ba6ca91a86bbc8a5804.tar.bz2 phpsandbox-5bc445bd93153f26bc520ba6ca91a86bbc8a5804.zip |
JS like trickery in PHP, discover generic object in PHP
Diffstat (limited to 'oo/blank_object.php')
-rw-r--r-- | oo/blank_object.php | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/oo/blank_object.php b/oo/blank_object.php new file mode 100644 index 0000000..25803d0 --- /dev/null +++ b/oo/blank_object.php @@ -0,0 +1,10 @@ +<?php + +/* stdClass is the default PHP object. stdClass has no properties, methods or parent. + * It does not support magic methods, and implements no interfaces. + * When you cast a scalar or array as Object, you get an instance of stdClass. Bare bones data structure for key-val entries + */ + +$obj = new StdClass(); +$obj->foo = 'bar'; + |