|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2018-02-27 18:00 UTC] nikic@php.net
-Status: Open
+Status: Not a bug
-Package: PHP Language Specification
+Package: Scripting Engine problem
[2018-02-27 18:00 UTC] nikic@php.net
[2018-02-27 18:07 UTC] elibyy at gmail dot com
[2018-02-27 19:25 UTC] nikic@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Dec 20 19:00:01 2025 UTC |
Description: ------------ In PHP 7 the error flow was changed that any code (even fully breaking) will pass in a try... catch block but if you create a class that implements an interface partially, you will get a fatal but no exception is thrown, and therefore breaks the script The error message is: Fatal error: Class B contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (A::thing1) Test script: --------------- <?php ini_set('error_reporting', E_ALL); ini_set('display_errors', 1); interface A { function thing(); function thing1(); } class B implements A { public function thing() { } } try{ new B(); }catch(\Throwable $t){ //expected to be catched }