{"action":"created","issue":{"url":"https://api.github.com/repos/phalcon/zephir/issues/1004","labels_url":"https://api.github.com/repos/phalcon/zephir/issues/1004/labels{/name}","comments_url":"https://api.github.com/repos/phalcon/zephir/issues/1004/comments","events_url":"https://api.github.com/repos/phalcon/zephir/issues/1004/events","html_url":"https://github.com/phalcon/zephir/issues/1004","id":88313655,"number":1004,"title":"Cannot redeclare class error on use str_len","user":{"login":"SliceOfLife","id":3955618,"avatar_url":"https://avatars.githubusercontent.com/u/3955618?v=3","gravatar_id":"","url":"https://api.github.com/users/SliceOfLife","html_url":"https://github.com/SliceOfLife","followers_url":"https://api.github.com/users/SliceOfLife/followers","following_url":"https://api.github.com/users/SliceOfLife/following{/other_user}","gists_url":"https://api.github.com/users/SliceOfLife/gists{/gist_id}","starred_url":"https://api.github.com/users/SliceOfLife/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SliceOfLife/subscriptions","organizations_url":"https://api.github.com/users/SliceOfLife/orgs","repos_url":"https://api.github.com/users/SliceOfLife/repos","events_url":"https://api.github.com/users/SliceOfLife/events{/privacy}","received_events_url":"https://api.github.com/users/SliceOfLife/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-06-15T04:39:48Z","updated_at":"2015-06-29T08:32:26Z","closed_at":null,"body":"```zep\r\nvar_dump(str_len(implode(\"-\", [1, 2])));\r\n```\r\nIf we try to call **str_len**, compiler fails with fatal error:\r\n```\r\nFatal error: require_once(): Cannot redeclare class zephir\\optimizers\\functioncall\\strlenoptimizer in .../zephir/Library/FunctionCall.php on line 210\r\n\r\nCall Stack:\r\n    0.0007     229024   1. {main}() .../zephir/compiler.php:0\r\n    0.0015     295680   2. Zephir\\Bootstrap::boot() .../zephir/compiler.php:21\r\n    0.0039     483608   3. Zephir\\Commands\\CommandAbstract->execute() .../zephir/Library/Bootstrap.php:200\r\n    0.0074    1148736   4. Zephir\\Compiler->compile() .../zephir/Library/Commands/CommandAbstract.php:92\r\n    0.0075    1149760   5. Zephir\\Compiler->generate() .../zephir/Library/Compiler.php:925\r\n    0.9968   56776728   6. Zephir\\CompilerFile->compile() .../zephir/Library/Compiler.php:817\r\n    0.9968   56777616   7. Zephir\\CompilerFile->compileClass() .../zephir/Library/CompilerFile.php:845\r\n    0.9968   56777616   8. Zephir\\ClassDefinition->compile() .../zephir/Library/CompilerFile.php:203\r\n    1.1664   57637328   9. Zephir\\ClassMethod->compile() .../zephir/Library/ClassDefinition.php:1126\r\n    1.1665   57612192  10. Zephir\\StatementsBlock->compile() .../zephir/Library/ClassMethod.php:1687\r\n    1.1670   57631136  11. Zephir\\Statements\\IfStatement->compile() .../zephir/Library/StatementsBlock.php:185\r\n    1.1670   57631272  12. Zephir\\Optimizers\\EvalExpression->optimize() .../zephir/Library/Statements/IfStatement.php:45\r\n    1.1670   57631584  13. Zephir\\Expression->compile() .../zephir/Library/Optimizers/EvalExpression.php:96\r\n    1.1670   57762728  14. Zephir\\Operators\\Logical\\AndOperator->compile() .../zephir/Library/Expression.php:535\r\n    1.1670   57762896  15. Zephir\\Expression->compile() .../zephir/Library/Operators/Logical/AndOperator.php:47\r\n    1.1670   57763112  16. Zephir\\Operators\\Comparison\\ComparisonBaseOperator->compile() .../zephir/Library/Expression.php:475\r\n    1.1671   57763376  17. Zephir\\Expression->compile() .../zephir/Library/Operators/Comparison/ComparisonBaseOperator.php:251\r\n    1.1671   57894552  18. Zephir\\FunctionCall->compile() .../zephir/Library/Expression.php:389\r\n    1.1671   57894552  19. Zephir\\FunctionCall->_callNormal() .../zephir/Library/FunctionCall.php:600\r\n    1.1671   57894632  20. Zephir\\FunctionCall->optimize() .../zephir/Library/FunctionCall.php:309\r\n```\r\n\r\nZephir version 0.7.0b [9cfba53]\r\n\r\n<bountysource-plugin>\r\n---\r\nWant to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/22069825-cannot-redeclare-class-error-on-use-str_len?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/116522877","html_url":"https://github.com/phalcon/zephir/issues/1004#issuecomment-116522877","issue_url":"https://api.github.com/repos/phalcon/zephir/issues/1004","id":116522877,"user":{"login":"SliceOfLife","id":3955618,"avatar_url":"https://avatars.githubusercontent.com/u/3955618?v=3","gravatar_id":"","url":"https://api.github.com/users/SliceOfLife","html_url":"https://github.com/SliceOfLife","followers_url":"https://api.github.com/users/SliceOfLife/followers","following_url":"https://api.github.com/users/SliceOfLife/following{/other_user}","gists_url":"https://api.github.com/users/SliceOfLife/gists{/gist_id}","starred_url":"https://api.github.com/users/SliceOfLife/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SliceOfLife/subscriptions","organizations_url":"https://api.github.com/users/SliceOfLife/orgs","repos_url":"https://api.github.com/users/SliceOfLife/repos","events_url":"https://api.github.com/users/SliceOfLife/events{/privacy}","received_events_url":"https://api.github.com/users/SliceOfLife/received_events","type":"User","site_admin":false},"created_at":"2015-06-29T08:32:26Z","updated_at":"2015-06-29T08:32:26Z","body":"I think, this is Mac OS-specific error, because file system is not case-sensitive.\r\nI put \r\n```php\r\n echo \"{$path}\\n\";\r\n```\r\nbefore\r\n```php\r\nrequire_once $path;\r\n```\r\nin .../zephir/Library/FunctionCall.php::optimize() at line 210 and got this:\r\n```\r\n.../zephir/Library/Optimizers/FunctionCall/JsonEncodeOptimizer.php\r\n.../zephir/Library/Optimizers/FunctionCall/ExplodeOptimizer.php\r\n.../zephir/Library/Optimizers/FunctionCall/FwriteOptimizer.php\r\n.../zephir/Library/Optimizers/FunctionCall/FcloseOptimizer.php\r\n.../zephir/Library/Optimizers/FunctionCall/ArrayKeysOptimizer.php\r\n.../zephir/Library/Optimizers/FunctionCall/ImplodeOptimizer.php\r\n.../zephir/Library/Optimizers/FunctionCall/UcfirstOptimizer.php\r\n.../zephir/Library/Optimizers/FunctionCall/MethodExistsOptimizer.php\r\n.../zephir/Library/Optimizers/FunctionCall/ExitOptimizer.php\r\n.../zephir/Library/Optimizers/FunctionCall/RtrimOptimizer.php\r\n.../zephir/Library/Optimizers/FunctionCall/CountOptimizer.php\r\n.../zephir/Library/Optimizers/FunctionCall/ClassExistsOptimizer.php\r\n.../zephir/Library/Optimizers/FunctionCall/FunctionExistsOptimizer.php\r\n.../zephir/Library/Optimizers/FunctionCall/VarDumpOptimizer.php\r\n.../zephir/Library/Optimizers/FunctionCall/StrLenOptimizer.php\r\n.../zephir/Library/Optimizers/FunctionCall/MtRandOptimizer.php\r\n.../zephir/Library/Optimizers/FunctionCall/StrReplaceOptimizer.php\r\n.../zephir/Library/Optimizers/FunctionCall/IsArrayOptimizer.php\r\n.../zephir/Library/Optimizers/FunctionCall/FloorOptimizer.php\r\n.../zephir/Library/Optimizers/FunctionCall/TimeOptimizer.php\r\n.../zephir/Library/Optimizers/FunctionCall/StrtolowerOptimizer.php\r\n.../zephir/Library/Optimizers/FunctionCall/StrlenOptimizer.php\r\nPHP Fatal error:  require_once(): Cannot redeclare class zephir\\optimizers\\functioncall\\strlenoptimizer in .../zephir/Library/FunctionCall.php on line 211\r\n```\r\n\r\nFirstly we call **StrLenOptimizer.php** and then **StrlenOptimizer.php**"}}