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

InvalidArgumentException for-loop over empty arrays #48

Closed
brunobraga opened this issue May 1, 2012 · 0 comments
Closed

InvalidArgumentException for-loop over empty arrays #48

brunobraga opened this issue May 1, 2012 · 0 comments

Comments

@brunobraga
Copy link
Contributor

While testing the library, I noticed this error when loading the h2o-php/example/i18n/index.php page:

Fatal error: Uncaught exception 'InvalidArgumentException' with message 'The for tag cannot iterate over the value: ' in h2o-php/h2o/tags.php:137
Stack trace:
#0 h2o-php/h2o/nodes.php(27): For_Tag->render(Object(H2o_Context), Object(StreamWriter))
#1 h2o-php/h2o/tags.php(172): NodeList->render(Object(H2o_Context), Object(StreamWriter))
#2 h2o-php/h2o/nodes.php(27): For_Tag->render(Object(H2o_Context), Object(StreamWriter))
#3 h2o-php/h2o.php(136): NodeList->render(Object(H2o_Context), Object(StreamWriter))
#4 h2o-php/example/i18n/index.php(44): H2o->render(Array)
#5 {main}
  thrown in h2o-php/h2o/tags.php on line 137

The issue happens because the index.php contains an empty array() for one of the user.tasks (3rd). The error does not happen if the array is not empty.

From version:
commit 93eee9c

brunobraga pushed a commit to brunobraga/h2o-php that referenced this issue Jun 27, 2013
  - Removed debugging Exception that is thrown if template variables
    loops over an empty array or null (see example/i18n/index.php for
    testing).
  - Cleaned up trailing spaces (and CRLF) of committing files.
  - Added smart to make i18n example work out of the box on Linux
    machines as well.
speedmax added a commit that referenced this issue Sep 6, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant