ID: 37258 Updated by: [EMAIL PROTECTED] Reported By: php-bugs at T43 dot mine dot nu Status: Open Bug Type: Documentation problem PHP Version: Irrelevant -Assigned To: +Assigned To: colder New Comment:
(A) will be fixed (B) "It is allowed to add member fields to just one instance." Even if it's possible, I don't think it's considered as a good practice. I'm not sure if it needs to be explicitely documented, at least I wouldn't recommend it. (D) will be fixed (E) will be fixed Previous Comments: ------------------------------------------------------------------------ [2006-05-01 14:08:54] php-bugs at T43 dot mine dot nu (E) english grammar (as seen by non-english like me) would require the OF removed in the first paragraph. ------------------------------------------------------------------------ [2006-05-01 14:06:41] php-bugs at T43 dot mine dot nu Thanks for the feedback. (A) "This is illustrated in the following example: " but then follow TWO examples, 19-1 and 19-2. English grammar requires "This is illustrated in the following examples: " And the examples are a bit meagre. The oop4 documentation was richer. (B) 2) "How to add a member to the class on the fly" I fail to see what you're trying to describe here. It is allowed to add member fields to just one instance. given class fruit has no field "sweet", one can add one to an instance, simply by $apple->sweet=true; (C) >>Until you've something new, this bug report seems bogus to me. Maybe, but classes, from the manual, have a very steep learning curve, even in php terms. (D) The reference to the class/object handling functions is missing. >From this it is unclear whether oop5 augments, or replaces oop4 documentation. ------------------------------------------------------------------------ [2006-05-01 13:47:39] [EMAIL PROTECTED] 1) "How to define a member, How to define a method" This is explained in this example: http://php.net/language.oop5.basic#AEN5708 2) "How to add a member to the class on the fly" I fail to see what you're trying to describe here. 3) "Constructors: the classname($var) syntax" This is already documented: "For backwards compatibility, if PHP 5 cannot find a __construct() function for a given class, it will search for the old-style constructor function, by the name of the class." 4) "There can only be one constructor, as opposed to C++." Who said PHP was like C++? This is how PHP works, you can't define two functions with the same name having different parameters. 5) "Further, when there is a constructor, the new operator has to use it." This is how functions/methods generally work, if an argument is not optional, you've to specify its value, nothing new/undocumented. Until you've something new, this bug report seems bogus to me. ------------------------------------------------------------------------ [2006-05-01 13:45:56] php-bugs at T43 dot mine dot nu The scope of members, defined on the fly (not in the class definition), is not specified. given $this->newmember='sweet', is newmember public? given $apple->newmember='sour', is newmember public? ------------------------------------------------------------------------ [2006-05-01 13:40:38] php-bugs at T43 dot mine dot nu The oop5 documentation does not point to the class handling functions (as the oop4 documentation did, on the very first, the 'class' page at the end.) ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/37258 -- Edit this bug report at http://bugs.php.net/?id=37258&edit=1
