php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #38943 serious misbehaviour extending ZipArchive class
Submitted: 2006-09-24 21:27 UTC Modified: 2006-09-24 22:30 UTC
From: judas dot iscariote at gmail dot com Assigned: pajoye (profile)
Status: Closed Package: Zip Related
PHP Version: 5CVS-2006-09-24 (CVS) OS: Linux
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: judas dot iscariote at gmail dot com
New email:
PHP Version: OS:

 

 [2006-09-24 21:27 UTC] judas dot iscariote at gmail dot com
Description:
------------
see the source, properties cannot be set correctly.



Reproduce code:
---------------
<?php
class myZip extends ZipArchive {
    public $testp = 1;
}

$z = new myZip;
$z->testp = 'foobar';
var_dump($z);
?>


Expected result:
----------------
object(myZip)#1 (6) {
  ["testp"]=>
  string(6) "foobar"
  ["status"]=>
  int(0)
  ["statusSys"]=>
  int(0)
  ["numFiles"]=>
  int(0)
  ["filename"]=>
  string(0) ""
  ["comment"]=>
  string(0) ""
}


Actual result:
--------------
Warning: Attempt to assign property of non-object in bug.php on line 7 

object(myZip)#1 (6) { 
["testp"]=>  
int(1) 
["status"]=>  
int(0) 
["statusSys"]=>  
int(0) 
["numFiles"]=>  
int(0) 
["filename"]=>  
string(0) "" 
["comment"]=>  
string(0) "" 
}

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-09-24 22:30 UTC] pajoye@php.net
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.

Thanks for this small test case :)

Fixed in 5.2 cvs and HEAD (6). Pecl release will follow later this week.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Fri May 09 11:01:28 2025 UTC