From fd3bde06fadec046092c5d976883599e759278e0 Mon Sep 17 00:00:00 2001 From: Anton Vasiliev Date: Sat, 13 Mar 2021 19:01:45 +0000 Subject: [PATCH] #2111 - Fix and update for better detection of class name entries --- Library/ClassMethod.php | 25 ++++--- ext/config.m4 | 4 +- ext/config.w32 | 2 + ext/stub.c | 4 + ext/stub.h | 2 + ext/stub/issettest.zep.c | 1 + ext/stub/namespaces/a/b/sub.zep.c | 26 +++++++ ext/stub/namespaces/a/b/sub.zep.h | 5 ++ ext/stub/namespaces/classentry.zep.c | 74 +++++++++++++++++++ ext/stub/namespaces/classentry.zep.h | 21 ++++++ ext/stub/nativearray.zep.c | 1 + ext/stub/oo/oodestruct.zep.c | 30 ++++---- ext/stub/oo/scopes/privatescopetester.zep.c | 2 +- ext/stub/optimizers/strreplace.zep.c | 2 +- .../properties/extendspublicproperties.zep.c | 1 + ext/stub/properties/propertyarray.zep.c | 7 +- ext/stub/properties/protectedproperties.zep.c | 1 + ext/stub/quantum.zep.c | 4 +- ext/stub/range.zep.c | 4 +- ext/stub/regexdna.zep.c | 4 +- ext/stub/requires.zep.c | 2 +- ext/stub/requires/external3.zep.c | 4 +- ext/stub/resourcetest.zep.c | 2 +- ext/stub/router.zep.c | 6 +- ext/stub/scall.zep.c | 8 +- ext/stub/scope.zep.c | 4 +- ext/stub/sort.zep.c | 6 +- ext/stub/spectralnorm.zep.c | 32 ++++---- ext/stub/strings.zep.c | 6 +- ext/stub/trytest.zep.c | 12 +-- stub/namespaces/a/b/sub.zep | 6 ++ stub/namespaces/classentry.zep | 16 ++++ tests/Extension/Namespaces/ClassEntryTest.php | 30 ++++++++ 33 files changed, 275 insertions(+), 79 deletions(-) create mode 100644 ext/stub/namespaces/a/b/sub.zep.c create mode 100644 ext/stub/namespaces/a/b/sub.zep.h create mode 100644 ext/stub/namespaces/classentry.zep.c create mode 100644 ext/stub/namespaces/classentry.zep.h create mode 100644 stub/namespaces/a/b/sub.zep create mode 100644 stub/namespaces/classentry.zep create mode 100644 tests/Extension/Namespaces/ClassEntryTest.php diff --git a/Library/ClassMethod.php b/Library/ClassMethod.php index 86913da6c1..d00e8a58e8 100644 --- a/Library/ClassMethod.php +++ b/Library/ClassMethod.php @@ -2557,11 +2557,12 @@ private function detectClassNameEntry(string $className, CompilationContext $com // Continue below execution } + $classNamespace = explode('\\', $className); + /** * Full namespace with class name */ if (strpos($className, '\\') === 0) { - $classNamespace = explode('\\', $className); $classNamespace = array_values(array_filter($classNamespace)); /** @@ -2579,18 +2580,18 @@ private function detectClassNameEntry(string $className, CompilationContext $com } $className = end($classNamespace); - } - - /** - * Check for partial namespace specification - * Example: Oo\Param, while namespace at the top is Stub - */ - $classNamespace = explode('\\', $className); - $className = end($classNamespace); - array_pop($classNamespace); + array_pop($classNamespace); + } else { + /** + * Check for partial namespace specification + * Example: Oo\Param, while namespace at the top is Stub + */ + $className = end($classNamespace); + array_pop($classNamespace); - if ($isAlias === false) { - array_unshift($classNamespace, $this->classDefinition->getNamespace()); + if ($isAlias === false) { + array_unshift($classNamespace, $this->classDefinition->getNamespace()); + } } $namespace = join('\\', $classNamespace); diff --git a/ext/config.m4 b/ext/config.m4 index 5e818b3185..6fe2f9c191 100644 --- a/ext/config.m4 +++ b/ext/config.m4 @@ -105,6 +105,8 @@ if test "$PHP_STUB" = "yes"; then stub/mcallinternal.zep.c stub/methodabstract.zep.c stub/methodargs.zep.c + stub/namespaces/a/b/sub.zep.c + stub/namespaces/classentry.zep.c stub/nativearray.zep.c stub/oo.zep.c stub/oo/abstractclass.zep.c @@ -215,7 +217,7 @@ if test "$PHP_STUB" = "yes"; then stub/12__closure.zep.c " PHP_NEW_EXTENSION(stub, $stub_sources, $ext_shared,, ) PHP_ADD_BUILD_DIR([$ext_builddir/kernel/]) - for dir in "stub stub/bench stub/builtin stub/flow stub/globals stub/globals/session stub/integration/psr/http/message stub/interfaces stub/invokes stub/mcall stub/oo stub/oo/extend stub/oo/extend/db stub/oo/extend/db/query stub/oo/extend/db/query/placeholder stub/oo/extend/spl stub/oo/scopes stub/ooimpl stub/optimizers stub/properties stub/requires stub/router stub/typehinting"; do + for dir in "stub stub/bench stub/builtin stub/flow stub/globals stub/globals/session stub/integration/psr/http/message stub/interfaces stub/invokes stub/mcall stub/namespaces stub/namespaces/a/b stub/oo stub/oo/extend stub/oo/extend/db stub/oo/extend/db/query stub/oo/extend/db/query/placeholder stub/oo/extend/spl stub/oo/scopes stub/ooimpl stub/optimizers stub/properties stub/requires stub/router stub/typehinting"; do PHP_ADD_BUILD_DIR([$ext_builddir/$dir]) done PHP_SUBST(STUB_SHARED_LIBADD) diff --git a/ext/config.w32 b/ext/config.w32 index 588cb5f7a6..48d2e48736 100644 --- a/ext/config.w32 +++ b/ext/config.w32 @@ -27,6 +27,8 @@ if (PHP_STUB != "no") { ADD_SOURCES(configure_module_dirname + "/stub/globals", "env.zep.c post.zep.c server.zep.c serverrequestfactory.zep.c", "stub"); ADD_SOURCES(configure_module_dirname + "/stub/integration/psr/http/message", "messageinterfaceex.zep.c", "stub"); ADD_SOURCES(configure_module_dirname + "/stub/mcall", "caller.zep.c", "stub"); + ADD_SOURCES(configure_module_dirname + "/stub/namespaces/a/b", "sub.zep.c", "stub"); + ADD_SOURCES(configure_module_dirname + "/stub/namespaces", "classentry.zep.c", "stub"); ADD_SOURCES(configure_module_dirname + "/stub/oo/extend/db/query/placeholder", "exception.zep.c", "stub"); ADD_SOURCES(configure_module_dirname + "/stub/oo/extend/spl", "arrayobject.zep.c directoryiterator.zep.c doublylinkedlist.zep.c fileinfo.zep.c fileobject.zep.c filesystemiterator.zep.c fixedarray.zep.c globiterator.zep.c heap.zep.c maxheap.zep.c minheap.zep.c priorityqueue.zep.c queue.zep.c recursivedirectoryiterator.zep.c stack.zep.c tempfileobject.zep.c", "stub"); ADD_SOURCES(configure_module_dirname + "/stub/optimizers", "isscalar.zep.c acos.zep.c arraymerge.zep.c asin.zep.c cos.zep.c createarray.zep.c ldexp.zep.c sin.zep.c sqrt.zep.c strreplace.zep.c substr.zep.c tan.zep.c", "stub"); diff --git a/ext/stub.c b/ext/stub.c index 1631571d12..fa8283907e 100644 --- a/ext/stub.c +++ b/ext/stub.c @@ -133,6 +133,8 @@ zend_class_entry *stub_mcalldynamic_ce; zend_class_entry *stub_mcallinternal_ce; zend_class_entry *stub_methodabstract_ce; zend_class_entry *stub_methodargs_ce; +zend_class_entry *stub_namespaces_a_b_sub_ce; +zend_class_entry *stub_namespaces_classentry_ce; zend_class_entry *stub_nativearray_ce; zend_class_entry *stub_oo_abstractclass_ce; zend_class_entry *stub_oo_ce; @@ -342,6 +344,8 @@ static PHP_MINIT_FUNCTION(stub) ZEPHIR_INIT(Stub_Mcall_Caller); ZEPHIR_INIT(Stub_MethodAbstract); ZEPHIR_INIT(Stub_MethodArgs); + ZEPHIR_INIT(Stub_Namespaces_A_B_Sub); + ZEPHIR_INIT(Stub_Namespaces_ClassEntry); ZEPHIR_INIT(Stub_NativeArray); ZEPHIR_INIT(Stub_Oo); ZEPHIR_INIT(Stub_Oo_AbstractClass); diff --git a/ext/stub.h b/ext/stub.h index eab71011ad..84b6ef8987 100644 --- a/ext/stub.h +++ b/ext/stub.h @@ -100,6 +100,8 @@ #include "stub/mcallinternal.zep.h" #include "stub/methodabstract.zep.h" #include "stub/methodargs.zep.h" +#include "stub/namespaces/a/b/sub.zep.h" +#include "stub/namespaces/classentry.zep.h" #include "stub/nativearray.zep.h" #include "stub/oo.zep.h" #include "stub/oo/abstractclass.zep.h" diff --git a/ext/stub/issettest.zep.c b/ext/stub/issettest.zep.c index aeffcb5116..d330cdde1b 100644 --- a/ext/stub/issettest.zep.c +++ b/ext/stub/issettest.zep.c @@ -28,6 +28,7 @@ ZEPHIR_INIT_CLASS(Stub_IssetTest) { zend_declare_property_null(stub_issettest_ce, SL("s"), ZEND_ACC_PUBLIC); stub_issettest_ce->create_object = zephir_init_properties_Stub_IssetTest; + return SUCCESS; } diff --git a/ext/stub/namespaces/a/b/sub.zep.c b/ext/stub/namespaces/a/b/sub.zep.c new file mode 100644 index 0000000000..c4589728f4 --- /dev/null +++ b/ext/stub/namespaces/a/b/sub.zep.c @@ -0,0 +1,26 @@ + +#ifdef HAVE_CONFIG_H +#include "../../../../ext_config.h" +#endif + +#include +#include "../../../../php_ext.h" +#include "../../../../ext.h" + +#include +#include +#include + +#include "kernel/main.h" + + +ZEPHIR_INIT_CLASS(Stub_Namespaces_A_B_Sub) { + + ZEPHIR_REGISTER_CLASS(Stub\\Namespaces\\A\\B, Sub, stub, namespaces_a_b_sub, NULL, 0); + + zend_declare_property_null(stub_namespaces_a_b_sub_ce, SL("value"), ZEND_ACC_PUBLIC); + + return SUCCESS; + +} + diff --git a/ext/stub/namespaces/a/b/sub.zep.h b/ext/stub/namespaces/a/b/sub.zep.h new file mode 100644 index 0000000000..697234fb09 --- /dev/null +++ b/ext/stub/namespaces/a/b/sub.zep.h @@ -0,0 +1,5 @@ + +extern zend_class_entry *stub_namespaces_a_b_sub_ce; + +ZEPHIR_INIT_CLASS(Stub_Namespaces_A_B_Sub); + diff --git a/ext/stub/namespaces/classentry.zep.c b/ext/stub/namespaces/classentry.zep.c new file mode 100644 index 0000000000..89395039ea --- /dev/null +++ b/ext/stub/namespaces/classentry.zep.c @@ -0,0 +1,74 @@ + +#ifdef HAVE_CONFIG_H +#include "../../ext_config.h" +#endif + +#include +#include "../../php_ext.h" +#include "../../ext.h" + +#include +#include +#include + +#include "kernel/main.h" +#include "kernel/memory.h" +#include "kernel/object.h" + + +ZEPHIR_INIT_CLASS(Stub_Namespaces_ClassEntry) { + + ZEPHIR_REGISTER_CLASS(Stub\\Namespaces, ClassEntry, stub, namespaces_classentry, stub_namespaces_classentry_method_entry, 0); + + return SUCCESS; + +} + +PHP_METHOD(Stub_Namespaces_ClassEntry, setParam) { + + zval *param, param_sub; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(¶m_sub); +#if PHP_VERSION_ID >= 80000 + bool is_null_true = 1; + ZEND_PARSE_PARAMETERS_START(1, 1) + Z_PARAM_OBJECT_OF_CLASS(param, stub_namespaces_a_b_sub_ce) + ZEND_PARSE_PARAMETERS_END(); + +#endif + + + zephir_fetch_params_without_memory_grow(1, 0, ¶m); + + + + RETVAL_ZVAL(param, 1, 0); + return; + +} + +PHP_METHOD(Stub_Namespaces_ClassEntry, setParamImported) { + + zval *param, param_sub; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(¶m_sub); +#if PHP_VERSION_ID >= 80000 + bool is_null_true = 1; + ZEND_PARSE_PARAMETERS_START(1, 1) + Z_PARAM_OBJECT_OF_CLASS(param, stub_namespaces_a_b_sub_ce) + ZEND_PARSE_PARAMETERS_END(); + +#endif + + + zephir_fetch_params_without_memory_grow(1, 0, ¶m); + + + + RETVAL_ZVAL(param, 1, 0); + return; + +} + diff --git a/ext/stub/namespaces/classentry.zep.h b/ext/stub/namespaces/classentry.zep.h new file mode 100644 index 0000000000..161e0e8dbe --- /dev/null +++ b/ext/stub/namespaces/classentry.zep.h @@ -0,0 +1,21 @@ + +extern zend_class_entry *stub_namespaces_classentry_ce; + +ZEPHIR_INIT_CLASS(Stub_Namespaces_ClassEntry); + +PHP_METHOD(Stub_Namespaces_ClassEntry, setParam); +PHP_METHOD(Stub_Namespaces_ClassEntry, setParamImported); + +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_stub_namespaces_classentry_setparam, 0, 1, Stub\\Namespaces\\A\\B\\Sub, 0) + ZEND_ARG_OBJ_INFO(0, param, Stub\\Namespaces\\A\\B\\Sub, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_stub_namespaces_classentry_setparamimported, 0, 1, Stub\\Namespaces\\A\\B\\Sub, 0) + ZEND_ARG_OBJ_INFO(0, param, Stub\\Namespaces\\A\\B\\Sub, 0) +ZEND_END_ARG_INFO() + +ZEPHIR_INIT_FUNCS(stub_namespaces_classentry_method_entry) { + PHP_ME(Stub_Namespaces_ClassEntry, setParam, arginfo_stub_namespaces_classentry_setparam, ZEND_ACC_PUBLIC) + PHP_ME(Stub_Namespaces_ClassEntry, setParamImported, arginfo_stub_namespaces_classentry_setparamimported, ZEND_ACC_PUBLIC) + PHP_FE_END +}; diff --git a/ext/stub/nativearray.zep.c b/ext/stub/nativearray.zep.c index 333e5cc8c3..ed1aeddec6 100644 --- a/ext/stub/nativearray.zep.c +++ b/ext/stub/nativearray.zep.c @@ -27,6 +27,7 @@ ZEPHIR_INIT_CLASS(Stub_NativeArray) { zend_declare_property_null(stub_nativearray_ce, SL("prefixes"), ZEND_ACC_PROTECTED); stub_nativearray_ce->create_object = zephir_init_properties_Stub_NativeArray; + return SUCCESS; } diff --git a/ext/stub/oo/oodestruct.zep.c b/ext/stub/oo/oodestruct.zep.c index efb2a0c52b..2634671d31 100644 --- a/ext/stub/oo/oodestruct.zep.c +++ b/ext/stub/oo/oodestruct.zep.c @@ -154,9 +154,8 @@ PHP_METHOD(Stub_Oo_OoDestruct, __construct) { zend_bool _30$$13; zend_class_entry *_26$$11 = NULL, *_22$$12 = NULL, *_32$$14 = NULL; zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zephir_fcall_cache_entry *_29 = NULL; zend_long width, height, ZEPHIR_LAST_CALL_STATUS; - zval *file_param = NULL, *width_param = NULL, *height_param = NULL, __$true, imageinfo, _0, _1, _2$$4, _3$$4, _4$$4, _9$$4, _28$$4, _5$$5, _6$$5, _7$$5, _8$$5, _10$$6, _11$$6, _12$$7, _13$$7, _14$$8, _15$$8, _16$$9, _17$$9, _18$$10, _19$$10, _20$$11, _25$$11, _27$$11, _21$$12, _23$$12, _24$$12, _35$$13, _36$$13, _37$$13, _38$$13, _39$$13, _40$$13, _31$$14, _33$$14, _34$$14; + zval *file_param = NULL, *width_param = NULL, *height_param = NULL, __$true, imageinfo, _0, _1, _2$$4, _3$$4, _4$$4, _9$$4, _28$$4, _29$$4, _5$$5, _6$$5, _7$$5, _8$$5, _10$$6, _11$$6, _12$$7, _13$$7, _14$$8, _15$$8, _16$$9, _17$$9, _18$$10, _19$$10, _20$$11, _25$$11, _27$$11, _21$$12, _23$$12, _24$$12, _35$$13, _36$$13, _37$$13, _38$$13, _39$$13, _40$$13, _31$$14, _33$$14, _34$$14; zval file; zval *this_ptr = getThis(); @@ -170,6 +169,7 @@ PHP_METHOD(Stub_Oo_OoDestruct, __construct) { ZVAL_UNDEF(&_4$$4); ZVAL_UNDEF(&_9$$4); ZVAL_UNDEF(&_28$$4); + ZVAL_UNDEF(&_29$$4); ZVAL_UNDEF(&_5$$5); ZVAL_UNDEF(&_6$$5); ZVAL_UNDEF(&_7$$5); @@ -265,7 +265,7 @@ PHP_METHOD(Stub_Oo_OoDestruct, __construct) { do { if (ZEPHIR_IS_LONG(&_9$$4, 1)) { zephir_read_property(&_10$$6, this_ptr, ZEND_STRL("file"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CALL_FUNCTION(&_11$$6, "imagecreatefromgif", NULL, 61, &_10$$6); + ZEPHIR_CALL_FUNCTION(&_11$$6, "imagecreatefromgif", NULL, 0, &_10$$6); zephir_check_call_status(); zephir_update_property_zval(this_ptr, ZEND_STRL("image"), &_11$$6); break; @@ -279,21 +279,21 @@ PHP_METHOD(Stub_Oo_OoDestruct, __construct) { } if (ZEPHIR_IS_LONG(&_9$$4, 3)) { zephir_read_property(&_14$$8, this_ptr, ZEND_STRL("file"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CALL_FUNCTION(&_15$$8, "imagecreatefrompng", NULL, 62, &_14$$8); + ZEPHIR_CALL_FUNCTION(&_15$$8, "imagecreatefrompng", NULL, 0, &_14$$8); zephir_check_call_status(); zephir_update_property_zval(this_ptr, ZEND_STRL("image"), &_15$$8); break; } if (ZEPHIR_IS_LONG(&_9$$4, 15)) { zephir_read_property(&_16$$9, this_ptr, ZEND_STRL("file"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CALL_FUNCTION(&_17$$9, "imagecreatefromwbmp", NULL, 63, &_16$$9); + ZEPHIR_CALL_FUNCTION(&_17$$9, "imagecreatefromwbmp", NULL, 0, &_16$$9); zephir_check_call_status(); zephir_update_property_zval(this_ptr, ZEND_STRL("image"), &_17$$9); break; } if (ZEPHIR_IS_LONG(&_9$$4, 16)) { zephir_read_property(&_18$$10, this_ptr, ZEND_STRL("file"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CALL_FUNCTION(&_19$$10, "imagecreatefromxbm", NULL, 64, &_18$$10); + ZEPHIR_CALL_FUNCTION(&_19$$10, "imagecreatefromxbm", NULL, 0, &_18$$10); zephir_check_call_status(); zephir_update_property_zval(this_ptr, ZEND_STRL("image"), &_19$$10); break; @@ -333,7 +333,8 @@ PHP_METHOD(Stub_Oo_OoDestruct, __construct) { } while(0); zephir_read_property(&_28$$4, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CALL_FUNCTION(NULL, "imagesavealpha", &_29, 65, &_28$$4, &__$true); + ZVAL_BOOL(&_29$$4, 1); + ZEPHIR_CALL_FUNCTION(NULL, "imagesavealpha", NULL, 0, &_28$$4, &_29$$4); zephir_check_call_status(); } else { _30$$13 = !width; @@ -359,14 +360,15 @@ PHP_METHOD(Stub_Oo_OoDestruct, __construct) { } ZVAL_LONG(&_35$$13, width); ZVAL_LONG(&_36$$13, height); - ZEPHIR_CALL_FUNCTION(&_37$$13, "imagecreatetruecolor", NULL, 66, &_35$$13, &_36$$13); + ZEPHIR_CALL_FUNCTION(&_37$$13, "imagecreatetruecolor", NULL, 0, &_35$$13, &_36$$13); zephir_check_call_status(); zephir_update_property_zval(this_ptr, ZEND_STRL("image"), &_37$$13); zephir_read_property(&_35$$13, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CALL_FUNCTION(NULL, "imagealphablending", NULL, 67, &_35$$13, &__$true); + ZEPHIR_CALL_FUNCTION(NULL, "imagealphablending", NULL, 61, &_35$$13, &__$true); zephir_check_call_status(); zephir_read_property(&_36$$13, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CALL_FUNCTION(NULL, "imagesavealpha", &_29, 65, &_36$$13, &__$true); + ZVAL_BOOL(&_38$$13, 1); + ZEPHIR_CALL_FUNCTION(NULL, "imagesavealpha", NULL, 0, &_36$$13, &_38$$13); zephir_check_call_status(); zephir_read_property(&_38$$13, this_ptr, ZEND_STRL("file"), PH_NOISY_CC | PH_READONLY); zephir_update_property_zval(this_ptr, ZEND_STRL("realpath"), &_38$$13); @@ -404,7 +406,7 @@ PHP_METHOD(Stub_Oo_OoDestruct, __destruct) { zephir_read_property(&_0, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY); ZEPHIR_CPY_WRT(&image, &_0); if (Z_TYPE_P(&image) == IS_RESOURCE) { - ZEPHIR_CALL_FUNCTION(NULL, "imagedestroy", NULL, 68, &image); + ZEPHIR_CALL_FUNCTION(NULL, "imagedestroy", NULL, 0, &image); zephir_check_call_status(); } ZEPHIR_MM_RESTORE(); @@ -460,7 +462,7 @@ PHP_METHOD(Stub_Oo_OoDestruct, check) { ZVAL_STRING(&_4, "2.0.1"); ZEPHIR_INIT_VAR(&_5); ZVAL_STRING(&_5, ">="); - ZEPHIR_CALL_FUNCTION(&_6, "version_compare", NULL, 69, &version, &_4, &_5); + ZEPHIR_CALL_FUNCTION(&_6, "version_compare", NULL, 62, &version, &_4, &_5); zephir_check_call_status(); if (UNEXPECTED(!zephir_is_true(&_6))) { ZEPHIR_INIT_VAR(&_7$$5); @@ -527,13 +529,13 @@ PHP_METHOD(Stub_Oo_OoDestruct, getVersion) { ZVAL_NULL(&version); ZEPHIR_INIT_VAR(&_3); ZVAL_STRING(&_3, "GD_VERSION"); - ZEPHIR_CALL_FUNCTION(&_4, "defined", NULL, 70, &_3); + ZEPHIR_CALL_FUNCTION(&_4, "defined", NULL, 63, &_3); zephir_check_call_status(); if (zephir_is_true(&_4)) { ZEPHIR_INIT_NVAR(&version); ZEPHIR_GET_CONSTANT(&version, "GD_VERSION"); } else { - ZEPHIR_CALL_FUNCTION(&info, "gd_info", NULL, 71); + ZEPHIR_CALL_FUNCTION(&info, "gd_info", NULL, 64); zephir_check_call_status(); ZEPHIR_INIT_VAR(&matches); ZVAL_NULL(&matches); diff --git a/ext/stub/oo/scopes/privatescopetester.zep.c b/ext/stub/oo/scopes/privatescopetester.zep.c index 3cdeca7c4a..d42792e1b8 100644 --- a/ext/stub/oo/scopes/privatescopetester.zep.c +++ b/ext/stub/oo/scopes/privatescopetester.zep.c @@ -148,7 +148,7 @@ PHP_METHOD(Stub_Oo_Scopes_PrivateScopeTester, getObjVars) { - ZEPHIR_RETURN_CALL_FUNCTION("get_object_vars", NULL, 72, obj); + ZEPHIR_RETURN_CALL_FUNCTION("get_object_vars", NULL, 65, obj); zephir_check_call_status(); RETURN_MM(); diff --git a/ext/stub/optimizers/strreplace.zep.c b/ext/stub/optimizers/strreplace.zep.c index 33aa49de50..6ec000580d 100644 --- a/ext/stub/optimizers/strreplace.zep.c +++ b/ext/stub/optimizers/strreplace.zep.c @@ -213,7 +213,7 @@ PHP_METHOD(Stub_Optimizers_StrReplace, issue732B) { zephir_array_fast_append(&replacements, &_0); ZEPHIR_INIT_VAR(&subject); ZVAL_STRING(&subject, "The quick brown fox jumped over the lazy dog."); - ZEPHIR_RETURN_CALL_FUNCTION("preg_replace", NULL, 73, &patterns, &replacements, &subject); + ZEPHIR_RETURN_CALL_FUNCTION("preg_replace", NULL, 66, &patterns, &replacements, &subject); zephir_check_call_status(); RETURN_MM(); diff --git a/ext/stub/properties/extendspublicproperties.zep.c b/ext/stub/properties/extendspublicproperties.zep.c index 8b5f7702fc..d7ea3804b3 100644 --- a/ext/stub/properties/extendspublicproperties.zep.c +++ b/ext/stub/properties/extendspublicproperties.zep.c @@ -27,6 +27,7 @@ ZEPHIR_INIT_CLASS(Stub_Properties_ExtendsPublicProperties) { zend_declare_property_null(stub_properties_extendspublicproperties_ce, SL("someGetterSetterArray"), ZEND_ACC_PROTECTED); stub_properties_extendspublicproperties_ce->create_object = zephir_init_properties_Stub_Properties_ExtendsPublicProperties; + return SUCCESS; } diff --git a/ext/stub/properties/propertyarray.zep.c b/ext/stub/properties/propertyarray.zep.c index 4db91c769a..95233953a3 100644 --- a/ext/stub/properties/propertyarray.zep.c +++ b/ext/stub/properties/propertyarray.zep.c @@ -42,6 +42,7 @@ ZEPHIR_INIT_CLASS(Stub_Properties_PropertyArray) { zend_declare_property_null(stub_properties_propertyarray_ce, SL("otherArray"), ZEND_ACC_PROTECTED); stub_properties_propertyarray_ce->create_object = zephir_init_properties_Stub_Properties_PropertyArray; + return SUCCESS; } @@ -157,12 +158,12 @@ PHP_METHOD(Stub_Properties_PropertyArray, testIssues1831) { } zephir_read_property(&_0$$3, this_ptr, ZEND_STRL("otherArray"), PH_NOISY_CC | PH_READONLY); ZEPHIR_MAKE_REF(&_0$$3); - ZEPHIR_CALL_FUNCTION(&info, "array_shift", &_1, 74, &_0$$3); + ZEPHIR_CALL_FUNCTION(&info, "array_shift", &_1, 67, &_0$$3); ZEPHIR_UNREF(&_0$$3); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_2$$3); ZVAL_STRING(&_2$$3, "header"); - ZEPHIR_CALL_FUNCTION(&_3$$3, "stripos", &_4, 75, &info, &_2$$3); + ZEPHIR_CALL_FUNCTION(&_3$$3, "stripos", &_4, 68, &info, &_2$$3); zephir_check_call_status(); if (!ZEPHIR_IS_FALSE_IDENTICAL(&_3$$3)) { zephir_array_append(&headers, &info, PH_SEPARATE, "stub/properties/propertyarray.zep", 51); @@ -170,7 +171,7 @@ PHP_METHOD(Stub_Properties_PropertyArray, testIssues1831) { } else { zephir_read_property(&_5$$5, this_ptr, ZEND_STRL("otherArray"), PH_NOISY_CC | PH_READONLY); ZEPHIR_MAKE_REF(&_5$$5); - ZEPHIR_CALL_FUNCTION(NULL, "array_unshift", &_6, 76, &_5$$5, &info); + ZEPHIR_CALL_FUNCTION(NULL, "array_unshift", &_6, 69, &_5$$5, &info); ZEPHIR_UNREF(&_5$$5); zephir_check_call_status(); break; diff --git a/ext/stub/properties/protectedproperties.zep.c b/ext/stub/properties/protectedproperties.zep.c index 31e5307e7f..24e5f493f1 100644 --- a/ext/stub/properties/protectedproperties.zep.c +++ b/ext/stub/properties/protectedproperties.zep.c @@ -71,6 +71,7 @@ ZEPHIR_INIT_CLASS(Stub_Properties_ProtectedProperties) { zend_declare_property_null(stub_properties_protectedproperties_ce, SL("someArrayVar"), ZEND_ACC_PROTECTED); stub_properties_protectedproperties_ce->create_object = zephir_init_properties_Stub_Properties_ProtectedProperties; + return SUCCESS; } diff --git a/ext/stub/quantum.zep.c b/ext/stub/quantum.zep.c index c96c04d5d4..486091545d 100644 --- a/ext/stub/quantum.zep.c +++ b/ext/stub/quantum.zep.c @@ -348,13 +348,13 @@ PHP_METHOD(Stub_Quantum, harmos) { ZVAL_STRING(&_52$$9, "%16.8lf %16.8lf %16.8lf \n"); ZVAL_DOUBLE(&_53$$9, ((double) i * dx)); ZVAL_DOUBLE(&_54$$9, ((double) n * dt)); - ZEPHIR_CALL_FUNCTION(NULL, "fprintf", &_55, 77, &fp, &_52$$9, &_53$$9, &_54$$9, &_51$$9); + ZEPHIR_CALL_FUNCTION(NULL, "fprintf", &_55, 70, &fp, &_52$$9, &_53$$9, &_54$$9, &_51$$9); zephir_check_call_status(); i = (i + 10); } ZEPHIR_INIT_NVAR(&_56$$8); ZVAL_STRING(&_56$$8, "\n"); - ZEPHIR_CALL_FUNCTION(NULL, "fprintf", &_55, 77, &fp, &_56$$8); + ZEPHIR_CALL_FUNCTION(NULL, "fprintf", &_55, 70, &fp, &_56$$8); zephir_check_call_status(); } j = 1; diff --git a/ext/stub/range.zep.c b/ext/stub/range.zep.c index 8da5daf375..49cdd24649 100644 --- a/ext/stub/range.zep.c +++ b/ext/stub/range.zep.c @@ -47,7 +47,7 @@ PHP_METHOD(Stub_Range, inclusive1) { ZVAL_LONG(&_0, 0); ZVAL_LONG(&_1, 10); - ZEPHIR_CALL_FUNCTION(&_2, "range", NULL, 78, &_0, &_1); + ZEPHIR_CALL_FUNCTION(&_2, "range", NULL, 71, &_0, &_1); zephir_check_call_status(); zephir_get_arrval(&_3, &_2); RETURN_CTOR(&_3); @@ -72,7 +72,7 @@ PHP_METHOD(Stub_Range, exclusive1) { ZVAL_LONG(&_0, 0); ZVAL_LONG(&_1, 10); - ZEPHIR_CALL_FUNCTION(&_2, "range", NULL, 78, &_0, &_1); + ZEPHIR_CALL_FUNCTION(&_2, "range", NULL, 71, &_0, &_1); zephir_check_call_status(); zephir_get_arrval(&_3, &_2); RETURN_CTOR(&_3); diff --git a/ext/stub/regexdna.zep.c b/ext/stub/regexdna.zep.c index dd2e1610b6..da39773034 100644 --- a/ext/stub/regexdna.zep.c +++ b/ext/stub/regexdna.zep.c @@ -187,7 +187,7 @@ PHP_METHOD(Stub_RegexDNA, process) { ZEPHIR_CONCAT_SVS(&_1, "/", &stuffToRemove, "/mS"); ZEPHIR_INIT_NVAR(&_0); ZVAL_STRING(&_0, ""); - ZEPHIR_CALL_FUNCTION(&_2, "preg_replace", &_3, 73, &_1, &_0, &contents); + ZEPHIR_CALL_FUNCTION(&_2, "preg_replace", &_3, 66, &_1, &_0, &contents); zephir_check_call_status(); ZEPHIR_CPY_WRT(&contents, &_2); ZEPHIR_INIT_VAR(&codeLength); @@ -231,7 +231,7 @@ PHP_METHOD(Stub_RegexDNA, process) { } } ZEPHIR_INIT_NVAR(®ex); - ZEPHIR_CALL_FUNCTION(&_2, "preg_replace", &_3, 73, &vIUB, &vIUBnew, &contents); + ZEPHIR_CALL_FUNCTION(&_2, "preg_replace", &_3, 66, &vIUB, &vIUBnew, &contents); zephir_check_call_status(); ZEPHIR_CPY_WRT(&contents, &_2); php_printf("%c", '\n'); diff --git a/ext/stub/requires.zep.c b/ext/stub/requires.zep.c index c6a3bd856f..f6985e0596 100644 --- a/ext/stub/requires.zep.c +++ b/ext/stub/requires.zep.c @@ -120,7 +120,7 @@ PHP_METHOD(Stub_Requires, requireExternal3) { ZEPHIR_CALL_METHOD(NULL, &external3, "__construct", NULL, 0); zephir_check_call_status(); } - ZEPHIR_CALL_METHOD(NULL, &external3, "req", NULL, 81, path, this_ptr); + ZEPHIR_CALL_METHOD(NULL, &external3, "req", NULL, 74, path, this_ptr); zephir_check_call_status(); RETURN_MM_MEMBER(getThis(), "content"); diff --git a/ext/stub/requires/external3.zep.c b/ext/stub/requires/external3.zep.c index 8357223614..dc6f43c8cd 100644 --- a/ext/stub/requires/external3.zep.c +++ b/ext/stub/requires/external3.zep.c @@ -56,12 +56,12 @@ PHP_METHOD(Stub_Requires_External3, req) { - ZEPHIR_CALL_FUNCTION(NULL, "ob_clean", NULL, 82); + ZEPHIR_CALL_FUNCTION(NULL, "ob_clean", NULL, 75); zephir_check_call_status(); if (zephir_require_zval(path) == FAILURE) { RETURN_MM_NULL(); } - ZEPHIR_CALL_FUNCTION(&_0, "ob_get_contents", NULL, 83); + ZEPHIR_CALL_FUNCTION(&_0, "ob_get_contents", NULL, 76); zephir_check_call_status(); ZEPHIR_CALL_METHOD(NULL, requires, "setcontent", NULL, 0, &_0); zephir_check_call_status(); diff --git a/ext/stub/resourcetest.zep.c b/ext/stub/resourcetest.zep.c index c7ceb30ea4..c882b414c6 100644 --- a/ext/stub/resourcetest.zep.c +++ b/ext/stub/resourcetest.zep.c @@ -129,7 +129,7 @@ PHP_METHOD(Stub_ResourceTest, testFunctionsForSTDIN) { ZEPHIR_INIT_VAR(&a); ZEPHIR_GET_CONSTANT(&a, "STDIN"); ZVAL_LONG(&_0, 1); - ZEPHIR_CALL_FUNCTION(NULL, "stream_set_blocking", NULL, 84, &a, &_0); + ZEPHIR_CALL_FUNCTION(NULL, "stream_set_blocking", NULL, 77, &a, &_0); zephir_check_call_status(); ZEPHIR_MM_RESTORE(); diff --git a/ext/stub/router.zep.c b/ext/stub/router.zep.c index 45d4c806ef..34ee488565 100644 --- a/ext/stub/router.zep.c +++ b/ext/stub/router.zep.c @@ -148,7 +148,7 @@ PHP_METHOD(Stub_Router, __construct) { add_assoc_long_ex(&_1$$3, SL("controller"), 1); ZEPHIR_INIT_VAR(&_2$$3); ZVAL_STRING(&_2$$3, "#^/([a-zA-Z0-9\\_\\-]+)[/]{0,1}$#"); - ZEPHIR_CALL_METHOD(NULL, &_0$$3, "__construct", &_3, 85, &_2$$3, &_1$$3); + ZEPHIR_CALL_METHOD(NULL, &_0$$3, "__construct", &_3, 78, &_2$$3, &_1$$3); zephir_check_call_status(); zephir_array_append(&routes, &_0$$3, PH_SEPARATE, "stub/router.zep", 89); ZEPHIR_INIT_NVAR(&_2$$3); @@ -160,7 +160,7 @@ PHP_METHOD(Stub_Router, __construct) { add_assoc_long_ex(&_4$$3, SL("params"), 3); ZEPHIR_INIT_VAR(&_5$$3); ZVAL_STRING(&_5$$3, "#^/([a-zA-Z0-9\\_\\-]+)/([a-zA-Z0-9\\.\\_]+)(/.*)*$#"); - ZEPHIR_CALL_METHOD(NULL, &_2$$3, "__construct", &_3, 85, &_5$$3, &_4$$3); + ZEPHIR_CALL_METHOD(NULL, &_2$$3, "__construct", &_3, 78, &_5$$3, &_4$$3); zephir_check_call_status(); zephir_array_append(&routes, &_2$$3, PH_SEPARATE, "stub/router.zep", 95); } @@ -1139,7 +1139,7 @@ PHP_METHOD(Stub_Router, add) { ZEPHIR_INIT_VAR(&route); object_init_ex(&route, stub_router_route_ce); - ZEPHIR_CALL_METHOD(NULL, &route, "__construct", NULL, 85, pattern, paths, httpMethods); + ZEPHIR_CALL_METHOD(NULL, &route, "__construct", NULL, 78, pattern, paths, httpMethods); zephir_check_call_status(); zephir_update_property_array_append(this_ptr, SL("_routes"), &route); RETURN_CCTOR(&route); diff --git a/ext/stub/scall.zep.c b/ext/stub/scall.zep.c index 683eab5423..2bf2f015b6 100644 --- a/ext/stub/scall.zep.c +++ b/ext/stub/scall.zep.c @@ -191,7 +191,7 @@ PHP_METHOD(Stub_Scall, testCall3) { ZEPHIR_MM_GROW(); - ZEPHIR_RETURN_CALL_SELF("testmethod3", &_0, 86); + ZEPHIR_RETURN_CALL_SELF("testmethod3", &_0, 79); zephir_check_call_status(); RETURN_MM(); @@ -282,7 +282,7 @@ PHP_METHOD(Stub_Scall, testCall6) { - ZEPHIR_RETURN_CALL_SELF("testmethod6", &_0, 87, a, b); + ZEPHIR_RETURN_CALL_SELF("testmethod6", &_0, 80, a, b); zephir_check_call_status(); RETURN_MM(); @@ -331,7 +331,7 @@ PHP_METHOD(Stub_Scall, testCall9) { ZEPHIR_MM_GROW(); - ZEPHIR_RETURN_CALL_SELF("testmethod3", &_0, 86); + ZEPHIR_RETURN_CALL_SELF("testmethod3", &_0, 79); zephir_check_call_status(); RETURN_MM(); @@ -422,7 +422,7 @@ PHP_METHOD(Stub_Scall, testCall12) { - ZEPHIR_RETURN_CALL_SELF("testmethod6", &_0, 87, a, b); + ZEPHIR_RETURN_CALL_SELF("testmethod6", &_0, 80, a, b); zephir_check_call_status(); RETURN_MM(); diff --git a/ext/stub/scope.zep.c b/ext/stub/scope.zep.c index e95099d367..18f1ff94aa 100644 --- a/ext/stub/scope.zep.c +++ b/ext/stub/scope.zep.c @@ -85,7 +85,7 @@ PHP_METHOD(Stub_Scope, test1) { ZEPHIR_INIT_VAR(&ret); ZVAL_STRING(&ret, ""); - ZEPHIR_CALL_SELF(&k, "getstr", &_0, 88); + ZEPHIR_CALL_SELF(&k, "getstr", &_0, 81); zephir_check_call_status(); r = 1; if (r == 1) { @@ -183,7 +183,7 @@ PHP_METHOD(Stub_Scope, test3) { } ZEPHIR_INIT_NVAR(&c); ZVAL_LONG(&c, _1); - ZEPHIR_CALL_SELF(&str$$3, "getdystr", &_3, 89, &c); + ZEPHIR_CALL_SELF(&str$$3, "getdystr", &_3, 82, &c); zephir_check_call_status(); zephir_concat_self(&k, &str$$3); } diff --git a/ext/stub/sort.zep.c b/ext/stub/sort.zep.c index 34c6ce61a3..67c451fb97 100644 --- a/ext/stub/sort.zep.c +++ b/ext/stub/sort.zep.c @@ -102,16 +102,16 @@ PHP_METHOD(Stub_Sort, quick) { } } } - ZEPHIR_CALL_METHOD(&_7, this_ptr, "quick", &_8, 90, &left); + ZEPHIR_CALL_METHOD(&_7, this_ptr, "quick", &_8, 83, &left); zephir_check_call_status(); ZEPHIR_INIT_VAR(&_9); zephir_create_array(&_9, 1, 0); ZEPHIR_INIT_VAR(&_10); ZVAL_LONG(&_10, pivot); zephir_array_fast_append(&_9, &_10); - ZEPHIR_CALL_METHOD(&_11, this_ptr, "quick", &_8, 90, &right); + ZEPHIR_CALL_METHOD(&_11, this_ptr, "quick", &_8, 83, &right); zephir_check_call_status(); - ZEPHIR_RETURN_CALL_FUNCTION("array_merge", NULL, 91, &_7, &_9, &_11); + ZEPHIR_RETURN_CALL_FUNCTION("array_merge", NULL, 84, &_7, &_9, &_11); zephir_check_call_status(); RETURN_MM(); diff --git a/ext/stub/spectralnorm.zep.c b/ext/stub/spectralnorm.zep.c index 222a2d6a2c..4f67cc0356 100644 --- a/ext/stub/spectralnorm.zep.c +++ b/ext/stub/spectralnorm.zep.c @@ -132,7 +132,7 @@ PHP_METHOD(Stub_SpectralNorm, Au) { j = _4$$3; ZVAL_LONG(&_7$$4, i); ZVAL_LONG(&_8$$4, j); - ZEPHIR_CALL_METHOD(&_6$$4, this_ptr, "ax", &_9, 92, &_7$$4, &_8$$4); + ZEPHIR_CALL_METHOD(&_6$$4, this_ptr, "ax", &_9, 85, &_7$$4, &_8$$4); zephir_check_call_status(); ZVAL_LONG(&_7$$4, j); ZEPHIR_CALL_METHOD(&_10$$4, u, "offsetget", &_11, 0, &_7$$4); @@ -218,7 +218,7 @@ PHP_METHOD(Stub_SpectralNorm, Atu) { j = _4$$3; ZVAL_LONG(&_7$$4, j); ZVAL_LONG(&_8$$4, i); - ZEPHIR_CALL_METHOD(&_6$$4, this_ptr, "ax", &_9, 92, &_7$$4, &_8$$4); + ZEPHIR_CALL_METHOD(&_6$$4, this_ptr, "ax", &_9, 85, &_7$$4, &_8$$4); zephir_check_call_status(); ZVAL_LONG(&_7$$4, j); ZEPHIR_CALL_METHOD(&_10$$4, u, "offsetget", &_11, 0, &_7$$4); @@ -266,9 +266,9 @@ PHP_METHOD(Stub_SpectralNorm, AtAu) { - ZEPHIR_CALL_METHOD(NULL, this_ptr, "au", NULL, 93, n, u, w); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "au", NULL, 86, n, u, w); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "atu", NULL, 94, n, w, v); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "atu", NULL, 87, n, w, v); zephir_check_call_status(); ZEPHIR_MM_RESTORE(); @@ -315,17 +315,17 @@ PHP_METHOD(Stub_SpectralNorm, process) { ZEPHIR_INIT_VAR(&u); object_init_ex(&u, spl_ce_SplFixedArray); ZVAL_LONG(&_0, n); - ZEPHIR_CALL_METHOD(NULL, &u, "__construct", NULL, 95, &_0); + ZEPHIR_CALL_METHOD(NULL, &u, "__construct", NULL, 88, &_0); zephir_check_call_status(); ZEPHIR_INIT_VAR(&v); object_init_ex(&v, spl_ce_SplFixedArray); ZVAL_LONG(&_0, n); - ZEPHIR_CALL_METHOD(NULL, &v, "__construct", NULL, 95, &_0); + ZEPHIR_CALL_METHOD(NULL, &v, "__construct", NULL, 88, &_0); zephir_check_call_status(); ZEPHIR_INIT_VAR(&w); object_init_ex(&w, spl_ce_SplFixedArray); ZVAL_LONG(&_0, n); - ZEPHIR_CALL_METHOD(NULL, &w, "__construct", NULL, 95, &_0); + ZEPHIR_CALL_METHOD(NULL, &w, "__construct", NULL, 88, &_0); zephir_check_call_status(); _3 = (n - 1); _2 = 0; @@ -343,15 +343,15 @@ PHP_METHOD(Stub_SpectralNorm, process) { i = _2; ZVAL_LONG(&_4$$3, i); ZVAL_LONG(&_5$$3, 1); - ZEPHIR_CALL_METHOD(NULL, &u, "offsetset", &_6, 96, &_4$$3, &_5$$3); + ZEPHIR_CALL_METHOD(NULL, &u, "offsetset", &_6, 89, &_4$$3, &_5$$3); zephir_check_call_status(); ZVAL_LONG(&_4$$3, i); ZVAL_LONG(&_5$$3, 1); - ZEPHIR_CALL_METHOD(NULL, &v, "offsetset", &_6, 96, &_4$$3, &_5$$3); + ZEPHIR_CALL_METHOD(NULL, &v, "offsetset", &_6, 89, &_4$$3, &_5$$3); zephir_check_call_status(); ZVAL_LONG(&_4$$3, i); ZVAL_LONG(&_5$$3, 1); - ZEPHIR_CALL_METHOD(NULL, &w, "offsetset", &_6, 96, &_4$$3, &_5$$3); + ZEPHIR_CALL_METHOD(NULL, &w, "offsetset", &_6, 89, &_4$$3, &_5$$3); zephir_check_call_status(); } } @@ -370,10 +370,10 @@ PHP_METHOD(Stub_SpectralNorm, process) { } i = _8; ZVAL_LONG(&_10$$4, n); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "atau", &_11, 97, &_10$$4, &u, &v, &w); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "atau", &_11, 90, &_10$$4, &u, &v, &w); zephir_check_call_status(); ZVAL_LONG(&_10$$4, n); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "atau", &_11, 97, &_10$$4, &v, &u, &w); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "atau", &_11, 90, &_10$$4, &v, &u, &w); zephir_check_call_status(); } } @@ -392,19 +392,19 @@ PHP_METHOD(Stub_SpectralNorm, process) { } i = _13; ZVAL_LONG(&_16$$5, i); - ZEPHIR_CALL_METHOD(&_15$$5, &u, "offsetget", &_17, 98, &_16$$5); + ZEPHIR_CALL_METHOD(&_15$$5, &u, "offsetget", &_17, 91, &_16$$5); zephir_check_call_status(); ZVAL_LONG(&_16$$5, i); - ZEPHIR_CALL_METHOD(&_18$$5, &v, "offsetget", &_17, 98, &_16$$5); + ZEPHIR_CALL_METHOD(&_18$$5, &v, "offsetget", &_17, 91, &_16$$5); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_19$$5); mul_function(&_19$$5, &_15$$5, &_18$$5); vBv += zephir_get_numberval(&_19$$5); ZVAL_LONG(&_16$$5, i); - ZEPHIR_CALL_METHOD(&_15$$5, &v, "offsetget", &_17, 98, &_16$$5); + ZEPHIR_CALL_METHOD(&_15$$5, &v, "offsetget", &_17, 91, &_16$$5); zephir_check_call_status(); ZVAL_LONG(&_16$$5, i); - ZEPHIR_CALL_METHOD(&_18$$5, &v, "offsetget", &_17, 98, &_16$$5); + ZEPHIR_CALL_METHOD(&_18$$5, &v, "offsetget", &_17, 91, &_16$$5); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_20$$5); mul_function(&_20$$5, &_15$$5, &_18$$5); diff --git a/ext/stub/strings.zep.c b/ext/stub/strings.zep.c index 77c8eeb152..da76fb331f 100644 --- a/ext/stub/strings.zep.c +++ b/ext/stub/strings.zep.c @@ -752,7 +752,7 @@ PHP_METHOD(Stub_Strings, strToHex) { _1$$3 = ZEPHIR_STRING_OFFSET(&value, i); ZEPHIR_INIT_NVAR(&_2$$3); ZVAL_STRINGL(&_2$$3, &_1$$3, 1); - ZEPHIR_CALL_FUNCTION(&_3$$3, "ord", &_4, 99, &_2$$3); + ZEPHIR_CALL_FUNCTION(&_3$$3, "ord", &_4, 92, &_2$$3); zephir_check_call_status(); ZEPHIR_CALL_FUNCTION(&_5$$3, "dechex", &_6, 10, &_3$$3); zephir_check_call_status(); @@ -817,13 +817,13 @@ PHP_METHOD(Stub_Strings, issue1267) { zephir_check_call_status(); ZEPHIR_CPY_WRT(value, &_4); ZEPHIR_INIT_NVAR(&_0); - ZEPHIR_CALL_FUNCTION(&_4, "strip_tags", &_5, 100, value); + ZEPHIR_CALL_FUNCTION(&_4, "strip_tags", &_5, 93, value); zephir_check_call_status(); zephir_stripslashes(&_0, &_4); ZEPHIR_INIT_VAR(&x); zephir_fast_trim(&x, &_0, NULL , ZEPHIR_TRIM_BOTH); ZEPHIR_INIT_VAR(&_6); - ZEPHIR_CALL_FUNCTION(&_7, "strip_tags", &_5, 100, value); + ZEPHIR_CALL_FUNCTION(&_7, "strip_tags", &_5, 93, value); zephir_check_call_status(); zephir_stripcslashes(&_6, &_7); zephir_fast_trim(return_value, &_6, NULL , ZEPHIR_TRIM_BOTH); diff --git a/ext/stub/trytest.zep.c b/ext/stub/trytest.zep.c index 7a147cec2c..9aefceb19c 100644 --- a/ext/stub/trytest.zep.c +++ b/ext/stub/trytest.zep.c @@ -205,7 +205,7 @@ PHP_METHOD(Stub_TryTest, testTry4) { object_init_ex(&_2$$5, spl_ce_RuntimeException); ZEPHIR_INIT_VAR(&_3$$5); ZVAL_STRING(&_3$$5, "error!"); - ZEPHIR_CALL_METHOD(NULL, &_2$$5, "__construct", NULL, 101, &_3$$5); + ZEPHIR_CALL_METHOD(NULL, &_2$$5, "__construct", NULL, 94, &_3$$5); zephir_check_call_status_or_jump(try_end_1); zephir_throw_exception_debug(&_2$$5, "stub/trytest.zep", 48); goto try_end_1; @@ -283,7 +283,7 @@ PHP_METHOD(Stub_TryTest, testTry5) { object_init_ex(&_2$$5, spl_ce_RuntimeException); ZEPHIR_INIT_VAR(&_3$$5); ZVAL_STRING(&_3$$5, "error!"); - ZEPHIR_CALL_METHOD(NULL, &_2$$5, "__construct", NULL, 101, &_3$$5); + ZEPHIR_CALL_METHOD(NULL, &_2$$5, "__construct", NULL, 94, &_3$$5); zephir_check_call_status_or_jump(try_end_1); zephir_throw_exception_debug(&_2$$5, "stub/trytest.zep", 65); goto try_end_1; @@ -360,7 +360,7 @@ PHP_METHOD(Stub_TryTest, testTry6) { object_init_ex(&_2$$5, spl_ce_RuntimeException); ZEPHIR_INIT_VAR(&_3$$5); ZVAL_STRING(&_3$$5, "error!"); - ZEPHIR_CALL_METHOD(NULL, &_2$$5, "__construct", NULL, 101, &_3$$5); + ZEPHIR_CALL_METHOD(NULL, &_2$$5, "__construct", NULL, 94, &_3$$5); zephir_check_call_status_or_jump(try_end_1); zephir_throw_exception_debug(&_2$$5, "stub/trytest.zep", 82); goto try_end_1; @@ -436,7 +436,7 @@ PHP_METHOD(Stub_TryTest, testTry7) { object_init_ex(&_2$$5, spl_ce_RuntimeException); ZEPHIR_INIT_VAR(&_3$$5); ZVAL_STRING(&_3$$5, "error!"); - ZEPHIR_CALL_METHOD(NULL, &_2$$5, "__construct", NULL, 101, &_3$$5); + ZEPHIR_CALL_METHOD(NULL, &_2$$5, "__construct", NULL, 94, &_3$$5); zephir_check_call_status_or_jump(try_end_1); zephir_throw_exception_debug(&_2$$5, "stub/trytest.zep", 101); goto try_end_1; @@ -536,7 +536,7 @@ PHP_METHOD(Stub_TryTest, testTry9) { /* try_start_1: */ - ZEPHIR_CALL_METHOD(NULL, this_ptr, "somemethod1", NULL, 102); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "somemethod1", NULL, 95); zephir_check_call_status_or_jump(try_end_1); RETURN_MM_STRING("not catched"); @@ -572,7 +572,7 @@ PHP_METHOD(Stub_TryTest, testTry10) { /* try_start_1: */ - ZEPHIR_CALL_METHOD(NULL, this_ptr, "somemethod2", NULL, 103); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "somemethod2", NULL, 96); zephir_check_call_status_or_jump(try_end_1); RETURN_MM_STRING("not catched"); diff --git a/stub/namespaces/a/b/sub.zep b/stub/namespaces/a/b/sub.zep new file mode 100644 index 0000000000..1a74f7f96b --- /dev/null +++ b/stub/namespaces/a/b/sub.zep @@ -0,0 +1,6 @@ +namespace Stub\Namespaces\A\B; + +class Sub +{ + public value; +} diff --git a/stub/namespaces/classentry.zep b/stub/namespaces/classentry.zep new file mode 100644 index 0000000000..9697882c16 --- /dev/null +++ b/stub/namespaces/classentry.zep @@ -0,0 +1,16 @@ +namespace Stub\Namespaces; + +use Stub\Namespaces\A\B\Sub; + +class ClassEntry +{ + public function setParam(<\Stub\Namespaces\A\B\Sub> param) -> <\Stub\Namespaces\A\B\Sub> + { + return param; + } + + public function setParamImported( param) -> + { + return param; + } +} diff --git a/tests/Extension/Namespaces/ClassEntryTest.php b/tests/Extension/Namespaces/ClassEntryTest.php new file mode 100644 index 0000000000..b268a66104 --- /dev/null +++ b/tests/Extension/Namespaces/ClassEntryTest.php @@ -0,0 +1,30 @@ + + * + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. + */ + +declare(strict_types=1); + +namespace Extension\Namespaces; + +use PHPUnit\Framework\TestCase; +use Stub\Namespaces\ClassEntry; +use Stub\Namespaces\A\B\Sub; + +final class ClassEntryTest extends TestCase +{ + public function testCorrectlyDetectClassEntryFromParam(): void + { + $subClass = new Sub(); + $class = new ClassEntry(); + + $this->assertInstanceOf(Sub::class, $class->setParam($subClass)); + $this->assertInstanceOf(Sub::class, $class->setParamImported($subClass)); + } +}