[PHP-DOC] cvs: phpdoc /en/functions strings.xml

2001-02-22 Thread Torben Wilson

torben  Thu Feb 22 16:05:35 2001 EDT

  Modified files:  
/phpdoc/en/functionsstrings.xml 
  Log:
  
  
  Clarified nl2br() refpurpose.
  
  
Index: phpdoc/en/functions/strings.xml
diff -u phpdoc/en/functions/strings.xml:1.73 phpdoc/en/functions/strings.xml:1.74
--- phpdoc/en/functions/strings.xml:1.73Thu Feb  8 02:27:59 2001
+++ phpdoc/en/functions/strings.xml Thu Feb 22 16:05:34 2001
@@ -1342,7 +1342,7 @@
   refentry id="function.nl2br"
refnamediv
 refnamenl2br/refname
-refpurposeConverts newlines to HTML line breaks/refpurpose
+refpurposeInserts HTML line breaks before all newlines in a string/refpurpose
/refnamediv
refsect1
 titleDescription/title





[PHP-DOC] cvs: phpdoc /en/language oop.xml

2001-02-22 Thread Torben Wilson

torben  Thu Feb 22 16:43:23 2001 EDT

  Modified files:  
/phpdoc/en/language oop.xml 
  Log:
  
  
  Added an example to help clarify the lack of non-constant variable 
  initializers in classes in PHP 4 (spurred by Bug #9414). 
  
  
Index: phpdoc/en/language/oop.xml
diff -u phpdoc/en/language/oop.xml:1.6 phpdoc/en/language/oop.xml:1.7
--- phpdoc/en/language/oop.xml:1.6  Fri Feb  9 11:41:08 2001
+++ phpdoc/en/language/oop.xml  Thu Feb 22 16:43:23 2001
@@ -40,10 +40,38 @@
 array of articles in the cart and two functions to add and remove
 items from this cart.
/para
-   notesimpara
-   In PHP 4, only constant initializers for literalvar/literal
-   variables are allowed. Use constructors for non-constant initializers.
-   /simpara/note
+
+   note
+simpara
+ In PHP 4, only constant initializers for literalvar/literal
+ variables are allowed. Use constructors for non-constant
+ initializers.  
+/simpara
+informalexample
+ programlisting role="php"
+/* None of these will work in PHP 4. */
+class Cart {
+var $todays_date = date("Y-m-d");
+var $name = $firstname;
+var $owner = 'Fred ' . 'Jones';
+}
+
+/* This is how it should be done. */
+class Cart {
+var $todays_date;
+var $name;
+var $owner;
+
+function Cart() {
+$this-todays_date = date("Y-m-d");
+$this-name = $GLOBALS['firstname'];
+/* etc. . . */
+}
+}
+ /programlisting
+/informalexample
+   /note
+
para
 Classes are types, that is, they are blueprints for actual
 variables. You have to create a variable of the desired type with
@@ -52,8 +80,8 @@
  
informalexample
 programlisting role="php"
- $cart = new Cart;
- $cart-add_item("10", 1);
+$cart = new Cart;
+$cart-add_item("10", 1);
 /programlisting
/informalexample