Doc #65261 [Com]: documentation needs updating

From: Date: Mon, 15 Jul 2013 08:05:12 +0000
Subject: Doc #65261 [Com]: documentation needs updating
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-10074@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=65261&edit=1 ID: 65261 Comment by: niel at gmail dot com Reported by: knight_adi2000 at yahoo dot com Summary: documentation needs updating Status: Open Type: Documentation Problem Package: Documentation problem Operating System: win 7 ultimate 32 bits PHP Version: Irrelevant Block user comment: N Private report: N New Comment: I don't really understand your point here. This behaviour is covered in the page for constructor/deconstructors: http://php.net/manual/en/language.oop5.decon.php "For backwards compatibility, if PHP 5 cannot find a __construct() function for a given class, and the class did not inherit one from a parent class, it will search for the old-style constructor function, by the name of the class. Effectively, it means that the only case that would have compatibility issues is if the class had a method named __construct() which was used for different semantics." Previous Comments: ------------------------------------------------------------------------ [2013-07-14 11:10:18] knight_adi2000 at yahoo dot com Description: ------------ --- From manual page: http://www.php.net/language.oop5.decon --- An issue that is not present anywhere in the documentation , please have an official stand regarding this . Test script: --------------- <?php class testing_name { /* public function __construct() { echo "Constructor function"; } */ public function testing_name() { echo "Function testing_name"; } } //End of class $var = new testing_name(); ?> Expected result: ---------------- When the object testing_name is created nothing else should happen . Actual result: -------------- In php 5.4.7 on windows 7 ultimate 32 bits , because the constructor is not present and the function name matches the class name , when the object is created , the function automaticly is called . If the constructor is present , than the result is a natural result and everything works fine . ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=65261&edit=1

« previous php.doc.bugs (#10074) next »