Edit report at https://bugs.php.net/bug.php?id=78776&edit=1
ID: 78776
Updated by: cmb@php.net
Reported by: mozafar dot gholami at gmail dot com
Summary: Abstract method implementation in trait
-Status: Open
+Status: Verified
Type: Bug
-Package: PHP Language Specification
+Package: Scripting Engine problem
Operating System: Win 10
PHP Version: 7.3.11
Block user comment: N
Private report: N
New Comment:
Confirmed: <https://3v4l.org/WgSfr>
Previous Comments:
------------------------------------------------------------------------
[2019-11-04 07:38:20] mozafar dot gholami at gmail dot com
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 this bug report at https://bugs.php.net/bug.php?id=78776&edit=1