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
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
33 - 18 = ?
Subscribe to this entry?

 
 [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

Add a Patch

Pull Requests

Add a Pull Request

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-2024 The PHP Group
All rights reserved.
Last updated: Sun Jun 16 17:01:29 2024 UTC