--- /dev/null
+<?php
+class myZip extends ZipArchive {
+ private $test = 0;
+ public $testp = 1;
+ private $testarray = array();
+
+ public function __construct() {
+ $this->testarray[] = 1;
+ var_dump($this->testarray);
+ }
+}
+
+$z = new myZip;
+$z->testp = "foobar";
+var_dump($z);
+
--- /dev/null
+--TEST--
+#38943, properties in extended class cannot be set (5.3)
+--SKIPIF--
+<?php
+/* $Id$ */
+if(!extension_loaded('zip')) die('skip');
+if (!defined('PHP_VERSION_MAJOR')) die('skip test for5.3+ only');
+?>
+--FILE--
+<?php
+include 'bug38943.inc';
+?>
+--EXPECTF--
+array(1) {
+ [0]=>
+ int(1)
+}
+object(myZip)#1 (%d) {
+ ["test":"myZip":private]=>
+ int(0)
+ ["testp"]=>
+ string(6) "foobar"
+ ["testarray":"myZip":private]=>
+ array(1) {
+ [0]=>
+ int(1)
+ }
+ ["status"]=>
+ int(0)
+ ["statusSys"]=>
+ int(0)
+ ["numFiles"]=>
+ int(0)
+ ["filename"]=>
+ string(0) ""
+ ["comment"]=>
+ string(0) ""
+}
--- /dev/null
+--TEST--
+Bug #12414 ( extracting files from damaged archives)
+--SKIPIF--
+<?php
+/*$ */
+if(!extension_loaded('zip')) die('skip');
+ ?>
+--FILE--
+<?php
+$filename = 'MYLOGOV2.GFX';
+$zipname = dirname(__FILE__) . "/pecl12414.zip";
+$za = new ZipArchive();
+$res =$za->open($zipname);
+if ($res === TRUE) {
+ $finfo=$za->statName($filename);
+ $file_size=$finfo['size'];
+
+ if($file_size>0) {
+ $contents=$za->getFromName($filename);
+
+ echo "ZIP contents size: " . strlen($contents) . "\n";
+ if(strlen($contents)!=$file_size) {
+ echo "zip_readfile recorded data does not match unpacked size: " . $zipname . " : " . $filename;
+ }
+ } else {
+ $contents=false;
+ echo "zip_readfile could not open stream from zero length file " . $zipname . " : " .$filename;
+ }
+
+ $za->close();
+} else {
+ echo "zip_readfile could not read from " . $zipname . " : " . $filename;
+}
+
+?>
+--DONE--
+--EXPECTF--
+ZIP contents size: %d
+zip_readfile recorded data does not match unpacked size: %specl12414.zip : MYLOGOV2.GFX