Mantis - Quercus
Viewing Issue Advanced Details
3402 minor always 03-20-09 14:11 03-20-09 18:36
koreth  
nam  
normal  
closed 4.0.0  
fixed  
none    
none 4.0.0  
0003402: exit() prints numeric exit codes to user
<?php
function my_exit($val=0) {
  if (time() == 0) {
    do_something_else($val);
  }
  exit($val);
}
my_exit(0);

Regular PHP and Quercus in interpreted mode print nothing. Quercus in compiled mode prints "0".

Patch:

--- a/modules/quercus/src/com/caucho/quercus/env/Env.java
+++ b/modules/quercus/src/com/caucho/quercus/env/Env.java
@@ -5244,7 +5244,7 @@ public class Env {
    */
   public Value exit(Value msg)
   {
- if (msg.isNull() || msg instanceof LongValue)
+ if (msg.isNull() || msg.isLongConvertible())
       return exit();
 
     try {

Notes
(0003914)
nam   
03-20-09 18:36   
php/33k6