Doc #78464 [NEW]: Abstract may not or cannot be instantiated?
| From: | weis at jelly dot cz | Date: | Tue, 27 Aug 2019 12:21:09 +0000 |
| Subject: | Doc #78464 [NEW]: Abstract may not or cannot be instantiated? | ||
| Groups: | php.doc.bugs | ||
| Request: | Send a blank email to doc-bugs+get-16910@lists.php.net to get a copy of this message | ||
From: weis at jelly dot cz
Operating system: ---
PHP version: Irrelevant
Package: PHP Language Specification
Bug Type: Documentation Problem
Bug description:Abstract may not or cannot be instantiated?
Description:
------------
---
From manual page: https://php.net/language.oop5.abstract
---
I suggest replace "may not" with "cannot" to make definition more
accurate in sentence "Classes defined as abstract may not be
instantiated, and any class that contains at least one abstract method
must also be abstract.".
PHP error message is also unambiguous:
Error: Cannot instantiate abstract class MyAbstractClass in
C:\path\to\file\index.php on line XYZ
Test script:
---------------
<?php
abstract class MyAbstractClass {
public function test()
{
echo 'test';
}
}
$a = new MyAbstractClass();
--
Edit bug report at https://bugs.php.net/bug.php?id=78464&edit=1
--
Fix committed: https://bugs.php.net/fix.php?id=78464&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=78464&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=78464&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=78464&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=78464&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=78464&r=support
Expected behavior: https://bugs.php.net/fix.php?id=78464&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=78464&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=78464&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=78464&r=globals
PHP version support discontinued: https://bugs.php.net/fix.php?id=78464&r=phptooold
Daylight Savings: https://bugs.php.net/fix.php?id=78464&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=78464&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=78464&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=78464&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=78464&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=78464&r=mysqlcfg