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
 [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: Thu Apr 18 22:01:28 2024 UTC