[PHP-BUG] Bug #76020 [NEW]: Not fully implemented class only generates fatal without exception

[email protected] ("elibyy at gmail dot com") Tue, 27 Feb 2018 17:50:53 GMT
Newsgroups php.standards
Message-ID <[email protected]>
From:             elibyy at gmail dot com
Operating system: Win/Nix
PHP version:      7.0.27
Package:          PHP Language Specification
Bug Type:         Bug
Bug description:Not fully implemented class only generates fatal without exception

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
}


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