}
if ((type == BP_VAR_W || type == BP_VAR_RW) && intern->nApplyCount > 0) {
- zend_error(E_WARNING, "Modification of ArrayObject during sorting is prohibited");
+ zend_throw_error(NULL, "Modification of ArrayObject during sorting is prohibited");
return &EG(error_zval);
}
}
if (intern->nApplyCount > 0) {
- zend_error(E_WARNING, "Modification of ArrayObject during sorting is prohibited");
+ zend_throw_error(NULL, "Modification of ArrayObject during sorting is prohibited");
return;
}
}
if (intern->nApplyCount > 0) {
- zend_error(E_WARNING, "Modification of ArrayObject during sorting is prohibited");
+ zend_throw_error(NULL, "Modification of ArrayObject during sorting is prohibited");
return;
}
}
if (intern->nApplyCount > 0) {
- zend_error(E_WARNING, "Modification of ArrayObject during sorting is prohibited");
+ zend_throw_error(NULL, "Modification of ArrayObject during sorting is prohibited");
return;
}
}
if (intern->nApplyCount > 0) {
- zend_error(E_WARNING, "Modification of ArrayObject during sorting is prohibited");
+ zend_throw_error(NULL, "Modification of ArrayObject during sorting is prohibited");
return;
}
$i = 0;
$ao->uasort(function($a, $b) use ($ao, &$i) {
if ($i++ == 0) {
- $ao->exchangeArray([4, 5, 6]);
+ try {
+ $ao->exchangeArray([4, 5, 6]);
+ } catch (Error $e) {
+ echo $e->getMessage(), "\n";
+ }
var_dump($ao);
}
return $a <=> $b;
});
?>
---EXPECTF--
-Warning: Modification of ArrayObject during sorting is prohibited in %s on line %d
+--EXPECT--
+Modification of ArrayObject during sorting is prohibited
object(ArrayObject)#1 (1) {
["storage":"ArrayObject":private]=>
array(3) {
$it = new ArrayIterator(array_fill(0,2,'X'), 1 );
function badsort($a, $b) {
+ try {
$GLOBALS['it']->unserialize($GLOBALS['it']->serialize());
- return 0;
+ } catch (Error $e) {
+ echo $e->getMessage(), "\n";
+ }
+ return 0;
}
$it->uksort('badsort');
?>
---EXPECTF--
-Warning: Modification of ArrayObject during sorting is prohibited in %sbug67539.php on line %d
+--EXPECT--
+Modification of ArrayObject during sorting is prohibited