Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compilation error for instanceof #1828

Closed
sergeyklay opened this issue Mar 10, 2019 · 2 comments
Closed

Compilation error for instanceof #1828

sergeyklay opened this issue Mar 10, 2019 · 2 comments
Assignees
Labels

Comments

@sergeyklay
Copy link
Contributor

Steps to reproduce:

public function test07(string test) -> bool
{
    var obj;
    let obj = new \stdClass;

    return obj instanceof test;
}

The error message:

In file included from /home/klay/.phpenv/versions/7.3.0-zts-debug/include/php/Zend/zend.h:27:0,
                 from /home/klay/.phpenv/versions/7.3.0-zts-debug/include/php/main/php.h:33,
                 from /home/klay/workspace/c/zephir-issue-1802/ext/bug/instance.zep.c:6:
/home/klay/workspace/c/zephir-issue-1802/ext/bug/instance.zep.c: In function ‘zim_Bug_Instance_test07’:
/home/klay/.phpenv/versions/7.3.0-zts-debug/include/php/Zend/zend_types.h:649:39: error: invalid type argument of unary ‘*’ (have ‘zval {aka struct _zval_struct}’)
 #define Z_STRVAL_P(zval_p)   Z_STRVAL(*(zval_p))
@joeyhub
Copy link

joeyhub commented Mar 26, 2019

This has always been a problem in php, you have to use is_a.

@sergeyklay
Copy link
Contributor Author

Fixed in the #1829

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants