Req #66476 [NEW]: Test if abstract conditions are OK
| From: | dev at toine dot pro | Date: | Mon, 13 Jan 2014 14:57:26 +0000 |
| Subject: | Req #66476 [NEW]: Test if abstract conditions are OK | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-183771@lists.php.net to get a copy of this message | ||
From: dev at toine dot pro
Operating system: Debian
PHP version: 5.4.24
Package: *General Issues
Bug Type: Feature/Change Request
Bug description:Test if abstract conditions are OK
Description:
------------
Hi!
Currently when we extends on abstract class we cannot test if all
conditions are met before instantiate the class.
This is not usefull, can you improve ReflectionClass::isInstantiable or
create new method for this feature?
Test script:
---------------
class classTest extends abstractTest {
// Missing methodTest
}
abstract class abstractTest {
abstract public function methodTest();
}
Expected result:
----------------
class classTest extends abstractTest {
// Missing methodTest
}
abstract class abstractTest {
abstract public function methodTest();
}
$reflectionClass = new ReflectionClass('calssTest');
if($reflectionClass->IsInstantiable()) {
// OK
} else {
// Cutom error
}
Actual result:
--------------
Fatal error: Class classTest contains 1 abstract method and must
therefore be declared abstract or implement the remaining methods
(abstractTest::methodTest)
--
Edit bug report at https://bugs.php.net/bug.php?id=66476&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=66476&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=66476&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=66476&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=66476&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=66476&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=66476&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=66476&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=66476&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=66476&r=support
Expected behavior: https://bugs.php.net/fix.php?id=66476&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=66476&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=66476&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=66476&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=66476&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=66476&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=66476&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=66476&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=66476&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=66476&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=66476&r=mysqlcfg