Mantis - Quercus
Viewing Issue Advanced Details
2830 minor always 08-08-08 12:40 08-11-08 14:44
koreth  
nam  
normal  
closed 3.2.0  
fixed  
none    
none 3.2.1  
0002830: Conditional function definition fails to compile
<?php
if (true) {
  function foo($arg) { }
}

Works fine in interpreted mode. In compiled mode, fails:

[12:36:05.643] {resin-13} Compiling _quercus/_test__php.java
[12:36:05.827] {resin-13} Quercus[/data/users/koreth/resin/webapps/ROOT/test.php] loading interpreted page instead because of compile error
[12:36:05.827] {resin-13} com.caucho.java.JavaCompileException: /data/users/koreth/resin/webapps/ROOT/WEB-INF/work/_quercus/_test__php.java:37: cannot find symbol
[12:36:05.827] {resin-13} symbol : variable fun_foo
[12:36:05.827] {resin-13} location: class _quercus._test__php
[12:36:05.827] {resin-13} env.addFunction("foo", fun_foo);

Notes
(0003319)
nam   
08-11-08 14:44   
php/37f-