From: Sebastian Bergmann Date: Sun, 12 May 2002 08:15:45 +0000 (+0000) Subject: Whitespace fixes. X-Git-Tag: php-4.3.0dev-ZendEngine2-Preview1~105 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=571d93e16a184668193330834cd3f508642e9847;p=php Whitespace fixes. --- diff --git a/Zend/ZEND_CHANGES b/Zend/ZEND_CHANGES index ffc4149f34..6a93c560d3 100644 --- a/Zend/ZEND_CHANGES +++ b/Zend/ZEND_CHANGES @@ -38,18 +38,18 @@ Changes in the Zend Engine 2.0 Hello; - } + function printHello() { + print $this->Hello; + } } class MyClass2 extends MyClass { - function printHello() { - MyClass::printHello(); /* Should print */ - print $this->Hello; /* Shouldn't print out anything */ - } + function printHello() { + MyClass::printHello(); /* Should print */ + print $this->Hello; /* Shouldn't print out anything */ + } } $obj = new MyClass(); @@ -103,23 +103,23 @@ Changes in the Zend Engine 2.0 id = self::$id++; - } + function MyCloneable() { + $this->id = self::$id++; + } - function __clone() { - $this->name = $clone->name; - $this->address = "New York"; - $this->id = self::$id++; - } + function __clone() { + $this->name = $clone->name; + $this->address = 'New York'; + $this->id = self::$id++; + } } $obj = new MyCloneable(); - $obj->name = "Hello"; - $obj->address = "Tel-Aviv"; + $obj->name = 'Hello'; + $obj->address = 'Tel-Aviv'; print $obj->id . "\n"; @@ -175,26 +175,26 @@ Changes in the Zend Engine 2.0 host' as $user\n"; - } + function db_connect($user) { + print "Connecting to MySQL database '$this->host' as $user\n"; + } } class DB::Oracle { - var $host = "localhost"; + var $host = 'localhost'; - function db_connect($user) { - print "Connecting to Oracle database '$this->host' as $user\n"; - } + function db_connect($user) { + print "Connecting to Oracle database '$this->host' as $user\n"; + } } $MySQL_obj = new DB::MySQL(); - $MySQL_obj->db_connect("Susan"); + $MySQL_obj->db_connect('Susan'); $Oracle_obj = new DB::Oracle(); - $Oracle_obj->db_connect("Barbara"); + $Oracle_obj->db_connect('Barbara'); ?> * Classes may contain constants. @@ -202,11 +202,11 @@ Changes in the Zend Engine 2.0 Example: * Current namespace's symbol tables are searched first for @@ -219,15 +219,15 @@ Changes in the Zend Engine 2.0 the same name. * In the scope of a function, the current namespace is that @@ -236,20 +236,20 @@ Changes in the Zend Engine 2.0 Example: bar(); - bar(); + $this->bar(); + bar(); } function bar() { - print "foobar\n"; + print "foobar\n"; } - } + } - $obj = new FooClass; - $obj->foo(); - $obj->foo(); + $obj = new FooClass; + $obj->foo(); + $obj->foo(); ?> This prints "foobar" two times, since a bar() method exists @@ -262,15 +262,15 @@ Changes in the Zend Engine 2.0 name = "MyDestructableClass"; + print "In constructor\n"; + $this->name = 'MyDestructableClass'; } function __destruct() { - print "Destroying " . $this->name . "\n"; + print 'Destroying ' . $this->name . "\n"; } - } + } - $obj = new MyDestructableClass(); + $obj = new MyDestructableClass(); ?> Like constructors, parent destructors will not be called @@ -410,31 +410,31 @@ Changes in the Zend Engine 2.0 exception = $exception; - } + function __construct($exception) { + $this->exception = $exception; + } - function Display() { - print "MyException: $this->exception\n"; - } + function Display() { + print "MyException: $this->exception\n"; + } } class MyExceptionFoo extends MyException { - function __construct($exception) { - $this->exception = $exception; - } + function __construct($exception) { + $this->exception = $exception; + } - function Display() { - print "MyException: $this->exception\n"; - } + function Display() { + print "MyException: $this->exception\n"; + } } try { - throw new MyExceptionFoo("Hello"); + throw new MyExceptionFoo('Hello'); } catch (MyException $exception) { - $exception->Display(); + $exception->Display(); } ?> @@ -445,29 +445,29 @@ Changes in the Zend Engine 2.0 Example: - draw(); - ShapeFactoryMethod("Square")->draw(); - ?> + ShapeFactoryMethod('Circle')->draw(); + ShapeFactoryMethod('Square')->draw(); + ?> * Static member variables of static classes can now be initialized. @@ -475,11 +475,11 @@ Changes in the Zend Engine 2.0 Example: * Supporting default values for by-reference function parameters. @@ -487,11 +487,11 @@ Changes in the Zend Engine 2.0 Example: @@ -524,7 +524,7 @@ Changes in the Zend Engine 1.0 without further coding. The return value may be changed by returning a value from the global scope of the included file or the evaluated string. For example, if 'return 7;' is executed in - the global scope of foo.inc, include("foo.inc") would evaluate + the global scope of foo.inc, include('foo.inc') would evaluate to 7. * Automatic resource deallocation. @@ -592,7 +592,7 @@ Changes in the Zend Engine 1.0 For example: - $foo[5]["bar"] = "foobar"; + $foo[5]['bar'] = 'foobar'; print "{$foo[5]["bar"]}"; // would print "foobar" * Ability to call member functions of other classes from within