ResinPRO 3.1.6 + PHP .... include() issues

Hello everybody,

I'd like to share the recent problem with Resin and PHP which I have.

I created very simple php file:

<?php
$file = '/opt/resinpro/webapps/dim/class.php';
include($file) or die();
?>

The error which I get is:

"/opt/resinpro/webapps/dim/index.php:2: Warning: '1' is not a valid path"

Does anybody have an idea why include() / require() don't work properly in this case on 3.1.6? Thanks in advance!

I've added it as a bug at

I've added it as a bug at http://bugs.caucho.com/view.php?id=2794.

It's a parsing precedence issue. Quercus is parsing it as

include(($file) or die());

The error is because ($file or die()) resolves to true, which converts to "1" as a string.

correct include() behavior

It is counter-intuitive, but the current parsing behavior follows PHP's behavior. In PHP,

include($file) or die();

is equivalent to

include $file or die();

The parentheses are optional and do not serve any purpose for include.