[PHP-BUG] Bug #78776 [NEW]: Abstract method implementation in trait

[email protected] ("mozafar dot gholami at gmail dot com") Mon, 04 Nov 2019 07:38:20 +0000
Newsgroups php.standards
Message-ID <[email protected]>
From:             mozafar dot gholami at gmail dot com
Operating system: Win 10
PHP version:      7.3.11
Package:          PHP Language Specification
Bug Type:         Bug
Bug description:Abstract method implementation in trait

Description:
------------
abstract methods should be implemented by child class and should not be
static but when the implementation comes from a trait it cloud be static
and code continue running without any problem. 

Test script:
---------------
<?php

abstract class A
{
    abstract public function createApp();
}

class B extends A
{
    use C;
}

trait C
{
    public static function createApp()
    {
        echo "You should not be here";
    }
}

B::createApp();

Expected result:
----------------
Error for not implementing abstract method


-- 
Edit bug report at https://bugs.php.net/bug.php?id=78776&edit=1
-- 
Fix committed:                    https://bugs.php.net/fix.php?id=78776&r=fixed
Fixed in release:                 https://bugs.php.net/fix.php?id=78776&r=alreadyfixed
Need backtrace:                   https://bugs.php.net/fix.php?id=78776&r=needtrace
Need Reproduce Script:            https://bugs.php.net/fix.php?id=78776&r=needscript
Try newer version:                https://bugs.php.net/fix.php?id=78776&r=oldversion
Not developer issue:              https://bugs.php.net/fix.php?id=78776&r=support
Expected behavior:                https://bugs.php.net/fix.php?id=78776&r=notwrong
Not enough info:                  https://bugs.php.net/fix.php?id=78776&r=notenoughinfo
Submitted twice:                  https://bugs.php.net/fix.php?id=78776&r=submittedtwice
register_globals:                 https://bugs.php.net/fix.php?id=78776&r=globals
PHP version support discontinued: https://bugs.php.net/fix.php?id=78776&r=phptooold
Daylight Savings:                 https://bugs.php.net/fix.php?id=78776&r=dst
IIS Stability:                    https://bugs.php.net/fix.php?id=78776&r=isapi
Install GNU Sed:                  https://bugs.php.net/fix.php?id=78776&r=gnused
Floating point limitations:       https://bugs.php.net/fix.php?id=78776&r=float
No Zend Extensions:               https://bugs.php.net/fix.php?id=78776&r=nozend
MySQL Configuration Error:        https://bugs.php.net/fix.php?id=78776&r=mysqlcfg