summaryrefslogtreecommitdiff
path: root/ext/zend_test
diff options
context:
space:
mode:
Diffstat (limited to 'ext/zend_test')
-rw-r--r--ext/zend_test/config.m46
-rw-r--r--ext/zend_test/php_test.h12
-rw-r--r--ext/zend_test/test.c33
3 files changed, 37 insertions, 14 deletions
diff --git a/ext/zend_test/config.m4 b/ext/zend_test/config.m4
index 242d195eb4..71d05026b9 100644
--- a/ext/zend_test/config.m4
+++ b/ext/zend_test/config.m4
@@ -1,5 +1,7 @@
-PHP_ARG_ENABLE(zend-test, whether to enable zend-test extension,
-[ --enable-zend-test Enable zend-test extension])
+PHP_ARG_ENABLE([zend-test],
+ [whether to enable zend-test extension],
+ [AS_HELP_STRING([--enable-zend-test],
+ [Enable zend-test extension])])
if test "$PHP_ZEND_TEST" != "no"; then
PHP_NEW_EXTENSION(zend_test, test.c, $ext_shared,, -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1)
diff --git a/ext/zend_test/php_test.h b/ext/zend_test/php_test.h
index 78ed445cd6..b76155e866 100644
--- a/ext/zend_test/php_test.h
+++ b/ext/zend_test/php_test.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 7 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2018 The PHP Group |
+ | Copyright (c) The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -33,13 +33,3 @@ ZEND_TSRMLS_CACHE_EXTERN()
#endif
#endif
-
-
-/*
- * Local variables:
- * tab-width: 4
- * c-basic-offset: 4
- * End:
- * vim600: noet sw=4 ts=4 fdm=marker
- * vim<600: noet sw=4 ts=4
- */
diff --git a/ext/zend_test/test.c b/ext/zend_test/test.c
index 87dcc90220..ad5f2fb446 100644
--- a/ext/zend_test/test.c
+++ b/ext/zend_test/test.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 7 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2018 The PHP Group |
+ | Copyright (c) The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -137,6 +137,7 @@ ZEND_FUNCTION(zend_leak_variable)
static zend_object *zend_test_class_new(zend_class_entry *class_type) /* {{{ */ {
zend_object *obj = zend_objects_new(class_type);
+ object_properties_init(obj, class_type);
obj->handlers = &zend_test_class_handlers;
return obj;
}
@@ -217,6 +218,36 @@ PHP_MINIT_FUNCTION(zend_test)
zend_declare_property_null(zend_test_class, "_StaticProp", sizeof("_StaticProp") - 1, ZEND_ACC_STATIC);
+ {
+ zend_string *name = zend_string_init("intProp", sizeof("intProp") - 1, 1);
+ zval val;
+ ZVAL_LONG(&val, 123);
+ zend_declare_typed_property(
+ zend_test_class, name, &val, ZEND_ACC_PUBLIC, NULL, ZEND_TYPE_ENCODE(IS_LONG, 0));
+ zend_string_release(name);
+ }
+
+ {
+ zend_string *name = zend_string_init("classProp", sizeof("classProp") - 1, 1);
+ zend_string *class_name = zend_string_init("stdClass", sizeof("stdClass") - 1, 1);
+ zval val;
+ ZVAL_NULL(&val);
+ zend_declare_typed_property(
+ zend_test_class, name, &val, ZEND_ACC_PUBLIC, NULL,
+ ZEND_TYPE_ENCODE_CLASS(class_name, 1));
+ zend_string_release(name);
+ }
+
+ {
+ zend_string *name = zend_string_init("staticIntProp", sizeof("staticIntProp") - 1, 1);
+ zval val;
+ ZVAL_LONG(&val, 123);
+ zend_declare_typed_property(
+ zend_test_class, name, &val, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC, NULL,
+ ZEND_TYPE_ENCODE(IS_LONG, 0));
+ zend_string_release(name);
+ }
+
INIT_CLASS_ENTRY(class_entry, "_ZendTestChildClass", NULL);
zend_test_child_class = zend_register_internal_class_ex(&class_entry, zend_test_class);