php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #78464 Abstract may not or cannot be instantiated?
Submitted: 2019-08-27 12:21 UTC Modified: 2019-09-01 09:25 UTC
From: weis at jelly dot cz Assigned: cmb (profile)
Status: Closed Package: Documentation problem
PHP Version: Irrelevant OS: ---
Private report: No CVE-ID: None
 [2019-08-27 12:21 UTC] weis at jelly dot cz
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();


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2019-08-28 08:05 UTC] cmb@php.net
-Package: PHP Language Specification +Package: Documentation problem
 [2019-09-01 09:25 UTC] cmb@php.net
Automatic comment from SVN on behalf of cmb
Revision: http://svn.php.net/viewvc/?view=revision&amp;revision=347912
Log: Fix #78464: Abstract may not or cannot be instantiated?
 [2019-09-01 09:25 UTC] cmb@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: cmb
 [2019-09-01 09:25 UTC] cmb@php.net
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.

Thank you for the report, and for helping us make our documentation better.
 [2019-09-01 09:30 UTC] salathe@php.net
Automatic comment on behalf of cmb
Revision: http://git.php.net/?p=doc/en.git;a=commit;h=88dc2faf8a39fc91ebca58a0260d10366ff93532
Log: Fix #78464: Abstract may not or cannot be instantiated?
 [2020-02-07 06:04 UTC] phpdocbot@php.net
Automatic comment on behalf of cmb
Revision: http://git.php.net/?p=doc/en.git;a=commit;h=9b5b5b7285b7c0da554909d9a6869ea33841a93c
Log: Fix #78464: Abstract may not or cannot be instantiated?
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon May 20 10:01:32 2024 UTC