|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #38544 tryeach
Submitted: 2006-08-22 12:16 UTC Modified: 2021-09-30 11:39 UTC
Avg. Score:2.0 ± 1.4
Reproduced:1 of 3 (33.3%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: dtyschenko at soft-ukraine dot com Assigned: cmb (profile)
Status: Wont fix Package: Scripting Engine problem
PHP Version: 5.1.5 OS: Any
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: dtyschenko at soft-ukraine dot com
New email:
PHP Version: OS:


 [2006-08-22 12:16 UTC] dtyschenko at soft-ukraine dot com
Sometimes I need to run few functions that can throw new exception

Reproduce code:

$errors = array();

try {
} catch (InvalidArgument $e) {
	$errors[] = $e->getMessage();

try {
} catch (InvalidArgument $e) {
	$errors[] = $e->getMessage();

// In this case tryeach operator can be very usefull

tryeach {
} catch (InvalidArgument $e) {
	$errors[] = $e->getMessage();



Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2006-08-22 12:25 UTC]
What's the problem with this ?

try {
} ...
 [2006-08-22 13:20 UTC] dtyschenko at soft-ukraine dot com
The keyword is each.
When user submit the form, you show them waht he misses. With try you will show only one error.
And with tryeach all errors.
 [2016-12-30 23:52 UTC]
-Package: Feature/Change Request +Package: Scripting Engine problem
 [2021-09-30 11:39 UTC]
-Status: Open +Status: Wont fix -Assigned To: +Assigned To: cmb
 [2021-09-30 11:39 UTC]
15 years and no further feedback on a doubtful feature request (in
my opinion, input validation should not throw exceptions), makes
me close this as WONTFIX.

If anybody is still interested in this feature, please pursue the
RFC process[1].

[1] <>
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Wed Jul 06 20:05:47 2022 UTC