Solved thread

This post is marked as solved. If you think the information contained on this thread must be part of the official documentation, please contribute submitting a pull request to its repository.

Using Fetch Word

This is my first try on zephir and I'm stuck on a ParseError Zephir\ParseException: Syntax error in /opt/yac/yac/core/content.zep on line 24

let result =  stmt->fetch(PDO::FETCH_OBJ);
------------------------^

Full code http://pastebin.com/P14XWT6e



5.8k
Accepted
answer

Fetch is a reserved word, you have to escape it by prepending a $:

stmt->$fetch(\PDO::FETCH_ASSOC);