php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #73697 SplHeap __construct method wrong modifier
Submitted: 2016-12-09 07:19 UTC Modified: 2016-12-09 07:31 UTC
From: fernando at null-life dot com Assigned:
Status: Not a bug Package: SPL related
PHP Version: 7.0.14 OS: *
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: fernando at null-life dot com
New email:
PHP Version: OS:

 

 [2016-12-09 07:19 UTC] 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 ...

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2016-12-09 07:31 UTC] requinix@php.net
-Status: Open +Status: Not a bug
 [2016-12-09 07:31 UTC] requinix@php.net
It is perfectly valid for a class to have a constructor and still be abstract.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sun Jul 13 02:01:32 2025 UTC