php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #69196 PharData should extends Phar
Submitted: 2015-03-06 11:00 UTC Modified: 2017-10-24 06:19 UTC
Votes:2
Avg. Score:3.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: hywan@php.net Assigned:
Status: Open Package: PHAR related
PHP Version: 5.6Git-2015-03-06 (Git) OS:
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2015-03-06 11:00 UTC] hywan@php.net
Description:
------------
According to the documentation, the PharData class (http://php.net/class.phardata) extends the Phar class. But when using the reflection, we see that the PharData class extends the RecursiveDirectoryIterator class.

It must extend the Phar class since it overrides some of their methods.

Test script:
---------------
$r = new ReflectionClass('PharData');
var_dump($r->getParentClass()->getName());

Expected result:
----------------
string(4) "Phar"

Actual result:
--------------
string(26) "RecursiveDirectoryIterator"

Patches

Add a Patch

Pull Requests

Pull requests:

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2015-03-07 03:06 UTC] reeze@php.net
-Summary: PharData extends Phar or not? +Summary: PharData should extends Phar
 [2015-03-07 03:06 UTC] reeze@php.net
I believe so.
 [2015-03-08 11:58 UTC] reeze@php.net
-Assigned To: +Assigned To: reeze
 [2015-03-29 07:13 UTC] mike@php.net
Not sure it should really be this way (Phar extends PharData or PharData extends Phar).

Not directly related: See also bug #52909
 [2015-03-30 03:26 UTC] reeze@php.net
-- Repost.

Hi Mike,

The bug #69196 could be fixed by specify different arg info IMO.

class Phar and PharData shared the most of the implementation, we could either fix doc or fix implementation, but as the documentation exist so long, I do prefer fix the implementation.
 [2015-03-30 09:50 UTC] mike@php.net
Sure, I'm with you, but I wouldn't fix implementation of "1+2 == 3" if documentation says "1+2 == 4". I just mean we should think about what is th right thing to do.
 [2017-10-24 06:19 UTC] kalle@php.net
-Status: Assigned +Status: Open -Assigned To: reeze +Assigned To:
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Mon Apr 22 04:01:25 2019 UTC