The comments designate that when NULL is specified, no error should be assigned.
The previous behavior was instead creating a new, empty error.
The error classes also seem to accept NULL values, which will create an empty error array (clearing existing values).
By passing NULL instead of creating an error object makes the behavior consistent with other code.
$object_return = new c_base_return_true();
if (is_null($error)) {
- $object_error = new c_base_error();
- $object_return->set_error($object_error);
- unset($object_error);
+ $object_return->set_error(NULL);
}
elseif (is_array($error)) {
foreach ($error as $delta => $value) {
$object_return = new c_base_return_false();
if (is_null($error)) {
- $object_error = new c_base_error();
- $object_return->set_error($object_error);
- unset($object_error);
+ $object_return->set_error(null);
}
elseif (is_array($error)) {
foreach ($error as $delta => $value) {