diff --git a/gnupg.c b/gnupg.c
index c14e44a..678bd54 100644
--- a/gnupg.c
+++ b/gnupg.c
@@ -173,13 +173,17 @@ zend_object_value gnupg_obj_new(zend_class_entry *class_type TSRMLS_DC){
zval *tmp;
zend_object_value retval;
- intern = emalloc(sizeof(gnupg_object));
+ intern = ecalloc(1, sizeof(gnupg_object));
intern->zo.ce = class_type;
+
+#if PHP_VERSION_ID < 50399
intern->zo.properties = NULL;
-
ALLOC_HASHTABLE (intern->zo.properties);
zend_hash_init (intern->zo.properties, 0, NULL, ZVAL_PTR_DTOR, 0);
zend_hash_copy (intern->zo.properties, &class_type->default_properties, (copy_ctor_func_t) zval_add_ref, (void *) &tmp, sizeof(zval *));
+#else
+ object_properties_init(&intern->zo, class_type);
+#endif
retval.handle = zend_objects_store_put(intern,NULL,(zend_objects_free_object_storage_t) gnupg_obj_dtor,NULL TSRMLS_CC);
retval.handlers = (zend_object_handlers *) & gnupg_object_handlers;
diff --git a/package.xml b/package.xml
index d8868d7..5a394b1 100644
--- a/package.xml
+++ b/package.xml
@@ -55,6 +55,7 @@ http://pear.php.net/dtd/package-2.0.xsd">
+
diff --git a/tests/gnupg_oo_export.phpt b/tests/gnupg_oo_export.phpt
index 1503ee5..c2028a7 100644
--- a/tests/gnupg_oo_export.phpt
+++ b/tests/gnupg_oo_export.phpt
@@ -11,8 +11,8 @@ $ret = $gpg -> export($fingerprint);
var_dump($ret);
?>
--EXPECTF--
-string(1336) "-----BEGIN PGP PUBLIC KEY BLOCK-----
-Version: GnuPG v1.4.3 (GNU/Linux)
+string(%d) "-----BEGIN PGP PUBLIC KEY BLOCK-----
+Version: GnuPG v1.%d.%d (GNU/Linux)
mQGiBENQAKwRBADpy828KU+0SuoetJTrJ5dR86PiO3CsH8K6QRP7wY82Eh/9NTJ3
afRj0FNPaVSP0NciPeM4G4uFoQ3lsIf+FBEPXH1D97/XigWObU8K6ha2/s8wU98z
diff --git a/tests/gnupg_res_export.phpt b/tests/gnupg_res_export.phpt
index 7fc14cf..50edf74 100644
--- a/tests/gnupg_res_export.phpt
+++ b/tests/gnupg_res_export.phpt
@@ -9,8 +9,8 @@ $ret = gnupg_export($gpg, $fingerprint);
var_dump($ret);
?>
--EXPECTF--
-string(1336) "-----BEGIN PGP PUBLIC KEY BLOCK-----
-Version: GnuPG v1.4.3 (GNU/Linux)
+string(%d) "-----BEGIN PGP PUBLIC KEY BLOCK-----
+Version: GnuPG v1.%d.%d (GNU/Linux)
mQGiBENQAKwRBADpy828KU+0SuoetJTrJ5dR86PiO3CsH8K6QRP7wY82Eh/9NTJ3
afRj0FNPaVSP0NciPeM4G4uFoQ3lsIf+FBEPXH1D97/XigWObU8K6ha2/s8wU98z