{"action":"created","issue":{"url":"https://api.github.com/repos/phalcon/zephir/issues/1126","labels_url":"https://api.github.com/repos/phalcon/zephir/issues/1126/labels{/name}","comments_url":"https://api.github.com/repos/phalcon/zephir/issues/1126/comments","events_url":"https://api.github.com/repos/phalcon/zephir/issues/1126/events","html_url":"https://github.com/phalcon/zephir/issues/1126","id":116750135,"number":1126,"title":"Invalid type argument of unary '*' (have 'zval')","user":{"login":"mruz","id":2629882,"avatar_url":"https://avatars.githubusercontent.com/u/2629882?v=3","gravatar_id":"","url":"https://api.github.com/users/mruz","html_url":"https://github.com/mruz","followers_url":"https://api.github.com/users/mruz/followers","following_url":"https://api.github.com/users/mruz/following{/other_user}","gists_url":"https://api.github.com/users/mruz/gists{/gist_id}","starred_url":"https://api.github.com/users/mruz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mruz/subscriptions","organizations_url":"https://api.github.com/users/mruz/orgs","repos_url":"https://api.github.com/users/mruz/repos","events_url":"https://api.github.com/users/mruz/events{/privacy}","received_events_url":"https://api.github.com/users/mruz/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/phalcon/zephir/labels/bug","name":"bug","color":"fc2929"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":24,"created_at":"2015-11-13T11:22:47Z","updated_at":"2015-12-02T14:02:47Z","closed_at":"2015-12-02T14:02:47Z","body":"On the PHP7:\r\n```zep\r\nprotected function stripPadding(string value) -> string\r\n    {\r\n        var pad, len;\r\n\r\n        let len = (int) strlen(value),\r\n            pad = (int) ord(value[len - 1]);\r\n\r\n        return this->paddingIsValid(pad, value) ? substr(value, 0, len - pad) : value;\r\n    }\r\n```\r\n\r\n```c\r\nPHP_METHOD(Ice_Crypt, stripPadding) {\r\n\r\n        unsigned char _0;\r\n        int pad = 0, len = 0, ZEPHIR_LAST_CALL_STATUS;\r\n        zval *value_param = NULL, _1, _2, _3, _4, _5;\r\n        zval value;\r\n        zval this_zv;\r\n        zval *this_ptr = getThis();\r\n        if (EXPECTED(this_ptr)) {\r\n                ZVAL_OBJ(&this_zv, Z_OBJ_P(this_ptr));\r\n                this_ptr = &this_zv;\r\n        } else this_ptr = NULL;\r\n\r\n        ZVAL_UNDEF(&value);\r\n        ZVAL_UNDEF(&_1);\r\n        ZVAL_UNDEF(&_2);\r\n        ZVAL_UNDEF(&_3);\r\n        ZVAL_UNDEF(&_4);\r\n        ZVAL_UNDEF(&_5);\r\n\r\n        ZEPHIR_MM_GROW();\r\n        zephir_fetch_params(1, 1, 0, &value_param);\r\n\r\n        zephir_get_strval(&value, value_param);\r\n\r\n\r\n        len = zephir_fast_strlen_ev(&value);\r\n        _0 = ZEPHIR_STRING_OFFSET(value, (len - 1));\r\n        ZVAL_LONG(&_1, _0);\r\n        ZEPHIR_CALL_FUNCTION(&_2, \"ord\", NULL, 69, &_1);\r\n        zephir_check_call_status();\r\n        pad = zephir_get_intval(&_2);\r\n        ZEPHIR_INIT_VAR(&_3);\r\n        ZVAL_LONG(&_1, pad);\r\n        ZEPHIR_CALL_METHOD(&_4, this_ptr, \"paddingisvalid\", NULL, 0, &_1, &value);\r\n        zephir_check_call_status();\r\n        if (zephir_is_true(&_4)) {\r\n                ZVAL_LONG(&_1, 0);\r\n                ZVAL_LONG(&_5, (len - pad));\r\n                zephir_substr(&_3, &value, 0 , zephir_get_intval(&_5), 0);\r\n        } else {\r\n                ZEPHIR_CPY_WRT(&_3, &value);\r\n        }\r\n        RETURN_CCTOR(_3);\r\n\r\n}\r\n```\r\n\r\n```log\r\nIn file included from /usr/include/php7/Zend/zend.h:35:0,\r\n                 from /usr/include/php7/main/php.h:35,\r\n                 from /home/mruz/framework/ext/ice/crypt.zep.c:6:\r\n/home/mruz/framework/ext/ice/crypt.zep.c: In function 'zim_Ice_Crypt_stripPadding':\r\n/usr/include/php7/Zend/zend_types.h:519:39: error: invalid type argument of unary '*' (have 'zval')\r\n #define Z_STRLEN_P(zval_p)   Z_STRLEN(*(zval_p))\r\n                                       ^\r\n/usr/include/php7/Zend/zend_string.h:41:26: note: in definition of macro 'ZSTR_LEN'\r\n #define ZSTR_LEN(zstr)  (zstr)->len\r\n                          ^\r\n/usr/include/php7/Zend/zend_types.h:518:36: note: in expansion of macro 'Z_STR'\r\n #define Z_STRLEN(zval)    ZSTR_LEN(Z_STR(zval))\r\n                                    ^\r\n/usr/include/php7/Zend/zend_types.h:519:30: note: in expansion of macro 'Z_STRLEN'\r\n #define Z_STRLEN_P(zval_p)   Z_STRLEN(*(zval_p))\r\n                              ^\r\n./kernel/operators.h:74:66: note: in expansion of macro 'Z_STRLEN_P'\r\n #define ZEPHIR_STRING_OFFSET(op1, index) ((index >= 0 && index < Z_STRLEN_P(op1)) ? Z_STRVAL_P(op1)[index] : '\\0')\r\n                                                                  ^\r\n/home/mruz/framework/ext/ice/crypt.zep.c:499:7: note: in expansion of macro 'ZEPHIR_STRING_OFFSET'\r\n  _0 = ZEPHIR_STRING_OFFSET(value, (len - 1));\r\n       ^\r\n/usr/include/php7/Zend/zend_types.h:516:39: error: invalid type argument of unary '*' (have 'zval')\r\n #define Z_STRVAL_P(zval_p)   Z_STRVAL(*(zval_p))\r\n                                       ^\r\n/usr/include/php7/Zend/zend_string.h:40:26: note: in definition of macro 'ZSTR_VAL'\r\n #define ZSTR_VAL(zstr)  (zstr)->val\r\n                          ^\r\n/usr/include/php7/Zend/zend_types.h:515:36: note: in expansion of macro 'Z_STR'\r\n #define Z_STRVAL(zval)    ZSTR_VAL(Z_STR(zval))\r\n                                    ^\r\n/usr/include/php7/Zend/zend_types.h:516:30: note: in expansion of macro 'Z_STRVAL'\r\n #define Z_STRVAL_P(zval_p)   Z_STRVAL(*(zval_p))\r\n                              ^\r\n./kernel/operators.h:74:85: note: in expansion of macro 'Z_STRVAL_P'\r\n #define ZEPHIR_STRING_OFFSET(op1, index) ((index >= 0 && index < Z_STRLEN_P(op1)) ? Z_STRVAL_P(op1)[index] : '\\0')\r\n                                                                                     ^\r\n/home/mruz/framework/ext/ice/crypt.zep.c:499:7: note: in expansion of macro 'ZEPHIR_STRING_OFFSET'\r\n  _0 = ZEPHIR_STRING_OFFSET(value, (len - 1));\r\n       ^\r\nmake: *** [ice/crypt.lo] Błąd 1\r\nmake: *** Oczekiwanie na niezakończone zadania....\r\n```\r\n\r\n<bountysource-plugin>\r\n---\r\nWant to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/28218172-invalid-type-argument-of-unary-have-zval?utm_campaign=plugin&utm_content=tracker%2F280146&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F280146&utm_medium=issues&utm_source=github).\r\n</bountysource-plugin>"},"comment":{"url":"https://api.github.com/repos/phalcon/zephir/issues/comments/161303282","html_url":"https://github.com/phalcon/zephir/issues/1126#issuecomment-161303282","issue_url":"https://api.github.com/repos/phalcon/zephir/issues/1126","id":161303282,"user":{"login":"steffengy","id":1194855,"avatar_url":"https://avatars.githubusercontent.com/u/1194855?v=3","gravatar_id":"","url":"https://api.github.com/users/steffengy","html_url":"https://github.com/steffengy","followers_url":"https://api.github.com/users/steffengy/followers","following_url":"https://api.github.com/users/steffengy/following{/other_user}","gists_url":"https://api.github.com/users/steffengy/gists{/gist_id}","starred_url":"https://api.github.com/users/steffengy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/steffengy/subscriptions","organizations_url":"https://api.github.com/users/steffengy/orgs","repos_url":"https://api.github.com/users/steffengy/repos","events_url":"https://api.github.com/users/steffengy/events{/privacy}","received_events_url":"https://api.github.com/users/steffengy/received_events","type":"User","site_admin":false},"created_at":"2015-12-02T14:02:47Z","updated_at":"2015-12-02T14:02:47Z","body":"Fixed that fail you mentioned previously.\r\nSince this issue contains multiple bug reports and is not very clear,\r\nclosing this for now.\r\nIf any issue is not fixed, that's mentioned here, please open a separate issue\r\nregarding only that concern."}}