cvs: ZendEngine2 / ZEND_CHANGES
| From: | Sebastian Bergmann | Date: | Wed, 04 Sep 2002 16:50:02 +0000 |
| Subject: | cvs: ZendEngine2 / ZEND_CHANGES | ||
| Groups: | php.zend-engine.cvs | ||
| Request: | Send a blank email to php-zend-engine-cvs+get-404@lists.php.net to get a copy of this message | ||
sebastian Wed Sep 4 12:50:02 2002 EDT
Modified files:
/ZendEngine2 ZEND_CHANGES
Log:
Whitespace fixes.
Index: ZendEngine2/ZEND_CHANGES
diff -u ZendEngine2/ZEND_CHANGES:1.37 ZendEngine2/ZEND_CHANGES:1.38
--- ZendEngine2/ZEND_CHANGES:1.37 Wed Sep 4 11:03:41 2002
+++ ZendEngine2/ZEND_CHANGES Wed Sep 4 12:50:01 2002
@@ -483,7 +483,7 @@
<?php
class foo {
- static $my_static = 5;
+ static $my_static = 5;
}
print foo::$my_static;
@@ -534,57 +534,66 @@
* __autoload(). TBD.
- * Method calls and property accesses can be overloaded by class
- methods __call(), __get() and __set().
- Examples:
-
- <?php
- class Setter {
- var $n;
- var $x = array("a"=>1,"b"=>2,"c"=>3);
- function __get($nm) {
- print "Getting [$nm]\n";
- if(isset($this->x[$nm])) {
- $r = $this->x[$nm];
- print "Returning: $r\n";
- return $r;
- } else {
- print "Nothing!\n";
- }
- }
- function __set($nm, $val) {
- print "Setting [$nm] to $val\n";
- if(isset($this->x[$nm])) {
- $this->x[$nm] = $val;
- print "OK!\n";
- } else {
- print "Not OK!\n";
- }
- }
- }
-
- $foo = new Setter();
- $foo->n = 1;
- $foo->a = 100;
- $foo->a++;
- $foo->z++;
- var_dump($foo);
- ?>
-
- <?php
- class Caller {
- var $x = array(1,2,3);
- function __call($m, $a) {
- print "Method $m called:\n";
- var_dump($a);
- return $this->x;
- }
- }
-
- $foo = new Caller();
- $a = $foo->test(1, "2", 3.4, true);
- var_dump($a);
- ?>
+ * Method calls and property accesses can be overloaded
+ by class methods __call(), __get() and __set().
+
+ __get() and __set() Example:
+
+ <?php
+ class Setter {
+ public $n;
+ public $x = array('a' => 1, 'b' => 2, 'c' => 3);
+
+ function __get($nm) {
+ print "Getting [$nm]\n";
+
+ if(isset($this->x[$nm])) {
+ $r = $this->x[$nm];
+ print "Returning: $r\n";
+ return $r;
+ } else {
+ print "Nothing!\n";
+ }
+ }
+
+ function __set($nm, $val) {
+ print "Setting [$nm] to $val\n";
+
+ if(isset($this->x[$nm])) {
+ $this->x[$nm] = $val;
+ print "OK!\n";
+ } else {
+ print "Not OK!\n";
+ }
+ }
+ }
+
+ $foo = new Setter();
+ $foo->n = 1;
+ $foo->a = 100;
+ $foo->a++;
+ $foo->z++;
+ var_dump($foo);
+ ?>
+
+ __call() Example:
+
+ <?php
+ class Caller {
+ var $x = array(1, 2, 3);
+
+ function __call($m, $a) {
+ print "Method $m called:\n";
+ var_dump($a);
+ return $this->x;
+ }
+ }
+
+ $foo = new Caller();
+ $a = $foo->test(1, '2', 3.4, true);
+ var_dump($a);
+ ?>
+
Changes in the Zend Engine 1.0