php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #67191 using namespace classname and same classname compile warning in extension
Submitted: 2014-05-03 15:36 UTC Modified: 2021-02-18 11:27 UTC
From: netyum at 163 dot com Assigned: nikic (profile)
Status: Closed Package: Compile Warning
PHP Version: 5.5.12 OS: linux
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: netyum at 163 dot com
New email:
PHP Version: OS:

 

 [2014-05-03 15:36 UTC] netyum at 163 dot com
Description:
------------
<?php
namespace Utils\Greeting;

class Greeting {

    public static function Greeting() {
        echo "In Greeting Method\n";
    }   
}

Greeting::Greeting();
?>

ok, this is no problem。

but my write down an extension(c code). feature to same up .

using namespace Utils\Greeting

run php 

show error:

PHP Warning:  Constructor utils\Greeting::Greeting() cannot be static in Unknown on line 0

Since php script, why not expand。

please see https://github.com/php/php-src/blob/master/Zend/zend_API.c in 2057 line.



Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2021-02-18 11:27 UTC] nikic@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: nikic
 [2021-02-18 11:27 UTC] nikic@php.net
I think this was already fixed earlier, but if nothing else the removal of PHP 4 constructor support in PHP 8 will have fixed this.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 04:01:28 2024 UTC