Bug #68872 [Opn->Nab]: all

From: Date: Wed, 21 Jan 2015 10:20:16 +0000
Subject: Bug #68872 [Opn->Nab]: all
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-190105@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=68872&edit=1 ID: 68872 Updated by: requinix@php.net Reported by: mlboy at 126 dot com Summary: all -Status: Open +Status: Not a bug Type: Bug Package: Class/Object related Operating System: centos7 PHP Version: 5.6.4 Block user comment: N Private report: N New Comment: Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://www.php.net/manual/ and the instructions on how to report a bug at http://bugs.php.net/how-to-report.php Previous Comments: ------------------------------------------------------------------------ [2015-01-21 10:16:39] spam dot remy at hotmail dot com That is correct behaviour. From http://php.net/manual/en/language.oop5.decon.php : 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. ------------------------------------------------------------------------ [2015-01-21 09:55:44] mlboy at 126 dot com Description: ------------ --- From manual page: http://www.php.net/language.oop5 --- when call a static funciton name with a same as class name will get this error. 1 <?php 2 class A{ 3 static public function A(){ 4 echo 'hi'; 5 } 6 } 7 A::A(); Fatal error: Constructor A::A() cannot be static in /t.php on line 6 Test script: --------------- <?php class A{ static public function A(){ echo 'hi'; } } A::A(); ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=68872&edit=1

« previous php.bugs (#190105) next »