Doc #73697 [Opn->Nab]: SplHeap __construct method wrong modifier
| From: | requinix@php.net | Date: | Fri, 09 Dec 2016 07:31:42 +0000 |
| Subject: | Doc #73697 [Opn->Nab]: SplHeap __construct method wrong modifier | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-14198@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=73697&edit=1
ID: 73697
Updated by: requinix@php.net
Reported by: fernando at null-life dot com
Summary: SplHeap __construct method wrong modifier
-Status: Open
+Status: Not a bug
Type: Documentation Problem
Package: SPL related
Operating System: *
PHP Version: 7.0.14
Block user comment: N
Private report: N
New Comment:
It is perfectly valid for a class to have a constructor and still be abstract.
Previous Comments:
------------------------------------------------------------------------
[2016-12-09 07:19:12] fernando at null-life dot com
Description:
------------
Documentation claims that __construct is public however the class is abstract and shouldnt be
instantiated
http://php.net/manual/en/splheap.construct.php
Test script:
---------------
<?php
$x = new SplHeap();
<?php
$x = SplHeap::__construct ();
Expected result:
----------------
PHP Fatal error: Uncaught Error: Cannot instantiate abstract class SplHeap in ...
Fatal error: Uncaught Error: Cannot call constructor in ...
Actual result:
--------------
PHP Fatal error: Uncaught Error: Cannot instantiate abstract class SplHeap in ...
Fatal error: Uncaught Error: Cannot call constructor in ...
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=73697&edit=1