#29617 [Opn->Bgs]: call_user_func_array doesn't handle correctly Exceptions

From: Date: Thu, 19 Aug 2004 04:53:33 +0000
Subject: #29617 [Opn->Bgs]: call_user_func_array doesn't handle correctly Exceptions
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-64911@lists.php.net to get a copy of this message
 ID:               29617
 Updated by:       tony2001@php.net
 Reported By:      jpbarrette at savoirfairelinux dot net
-Status:           Open
+Status:           Bogus
 Bug Type:         Scripting Engine problem
 Operating System: Mandrake linux 10.0 (Community)
 PHP Version:      5.0.0
 New Comment:

Duplicate of #28934.


Previous Comments:
------------------------------------------------------------------------

[2004-08-19 01:34:28] JustinHagstrom at yahoo dot com

This bug was already reported here:
http://bugs.php.net/bug.php?id=28934

------------------------------------------------------------------------

[2004-08-16 06:44:25] php dot net at benjamin dot schulz dot name

this is 5.0.1 here

------------------------------------------------------------------------

[2004-08-16 06:42:46] php dot net at benjamin dot schulz dot name

i experienced this problem,  too:
Sample Code:
------------
<?php

function foo()
{
    throw new Exception();
}

try {
    foo();
} catch(Exception $e) {
    echo __LINE__, '<br />';
}

try {
    call_user_func('foo');
} catch(Exception $e) {
    echo __LINE__, '<br />';
}

try {
    call_user_func_array('foo', array());
} catch(Exception $e) {
    echo __LINE__, '<br />';
}

?>

Expected Result
---------------
11
17
23

Actual Result
-------------
11
17

Warning: call_user_func_array() [function.call-user-func-array]: Unable
to call foo() in /home/eskaly/dev/test.php on line 27
23

------------------------------------------------------------------------

[2004-08-11 17:26:48] jpbarrette at savoirfairelinux dot net

The fixed code: 
 
<?php 
 
function test($test) { 
  throw new Exception("This is a " . $test); 
} 
 
call_user_func_array("test", array("test")); 
 
?>

------------------------------------------------------------------------

[2004-08-11 17:23:22] derick@php.net

Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves. 

A proper reproducing script starts with <?php and ends with ?>,
is max. 10-20 lines long and does not require any external 
resources such as databases, etc.

If possible, make the script source available online and provide
an URL to it here. Try avoid embedding huge scripts into the report.

------------------------------------------------------------------------

The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
    http://bugs.php.net/29617

-- 
Edit this bug report at http://bugs.php.net/?id=29617&edit=1


Thread (8 messages)

« previous php.bugs (#64911) next »