ID: 38544
Updated by: [EMAIL PROTECTED]
Reported By: dtyschenko at soft-ukraine dot com
-Status: Open
+Status: Feedback
Bug Type: Feature/Change Request
Operating System: Any
PHP Version: 5.1.5
New Comment:
What's the problem with this ?
try {
$Item->Title($_POST['title']);
$Item->Content($_POST['content']);
} ...
Previous Comments:
------------------------------------------------------------------------
[2006-08-22 12:16:35] dtyschenko at soft-ukraine dot com
Description:
------------
Sometimes I need to run few functions that can throw new exception
Reproduce code:
---------------
<?php
$errors = array();
try {
$Item->Title($_POST['title']);
} catch (InvalidArgument $e) {
$errors[] = $e->getMessage();
}
try {
$Item->Content($_POST['content']);
} catch (InvalidArgument $e) {
$errors[] = $e->getMessage();
}
// In this case tryeach operator can be very usefull
tryeach {
$Item->Title($_POST['title']);
$Item->Content($_POST['content']);
} catch (InvalidArgument $e) {
$errors[] = $e->getMessage();
}
?>
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=38544&edit=1