|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2019-01-16 15:52 UTC] nikic@php.net
-Status: Open
+Status: Verified
[2019-01-16 15:52 UTC] nikic@php.net
[2019-01-25 10:36 UTC] nikic@php.net
[2019-01-30 08:31 UTC] nikic@php.net
-Status: Verified
+Status: Wont fix
[2019-01-30 08:31 UTC] nikic@php.net
[2019-01-30 09:58 UTC] bas at dmt-software dot nl
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Nov 04 23:00:01 2025 UTC |
Description: ------------ A class without __construct method cannot use a trait that has a method that equals the class it's name. It will execute the trait method as constructor when E_DEPRECATED errors are ignored. This should never happen. Test script: --------------- error_reporting(E_ALL ^ E_DEPRECATED); class Callback { use CallbackTrait; } trait CallbackTrait { public function callback() { echo 'this is called'; } } new Callback(); --- https://3v4l.org/CWBai Expected result: ---------------- It should ignore the method as constructor like extends does or it should trigger a fatal error as it does when a constructor is present (https://3v4l.org/nbh6X)