Not that exact structure, but you can set something up like it if the track_errors directive is on:
$cmds = array (
"myfunc(something);",
"some_other_command(s);",
"otherfunc(otherparm);"
);
for ($i = 0; $i < count ($cmds); $i++)
{
eval ("@$cmds[$i]");
if ($php_errormsg)
break;
}
if ($php_errormsg)
echo "Error occurred: $php_errormsg\n";
Alternatively you could reinstitute the $x variable in each command then check it so you wouldn't have to rely on $php_errormsg:
$cmds = array (
"\$x = myfunc(something);",
"some_other_command(s);",
"\$x = otherfunc(otherparm);"
);
for ($x = 0, $i = 0; $i < count ($cmds); $i++)
{
eval ($cmds[$i]);
if ($x)
break;
}
if ($x)
echo "Error occurred: $x\n";