SP
try{
$pos = strpos($str, $substring);
} catch (SubstringNotFound $error) {
// not found
}
дичь)
Size: a a a
SP
try{
$pos = strpos($str, $substring);
} catch (SubstringNotFound $error) {
// not found
}
AC
KN
KN
KN
KN
AC
try{
$pos = strpos($str, $substring);
} catch (SubstringNotFound $error) {
// not found
}
SP
KN
KN
АГ
try{
$pos = strpos($str, $substring);
} catch (SubstringNotFound $error) {
// not found
}
KN
SP
try {
$validator->validate($data); // return type void?
} catch (NotValidException $e) {
// errors
}
KN
if ($result > 0) { /* error */ }
так
что семантически - это всё же попытка сделать так же как в си, только чуть получшеАГ
SP
$errors = $validator->validate($data);
if (!$errors->empty()) {
// something wrong with a request
}
KN
if ($result->hasErrors())
логичнееKN
T
KN