1
0
mirror of https://github.com/php/php-src.git synced 2026-03-25 08:42:29 +01:00
Files
archived-php-src/ext/spl/tests/ArrayObject_illegal_offset.phpt
Gabriel Caruso 4aabfe911e Revert "Update versions for PHP 8.0.21"
This reverts commit 6eedacdf15.
2022-07-06 12:06:48 +02:00

40 lines
680 B
PHP

--TEST--
ArrayObject illegal offset
--FILE--
<?php
$ao = new ArrayObject([1, 2, 3]);
try {
var_dump($ao[[]]);
} catch (TypeError $e) {
echo $e->getMessage(), "\n";
}
try {
$ao[[]] = new stdClass;
} catch (TypeError $e) {
echo $e->getMessage(), "\n";
}
try {
$ref =& $ao[[]];
} catch (TypeError $e) {
echo $e->getMessage(), "\n";
}
try {
var_dump(isset($ao[[]]));
} catch (TypeError $e) {
echo $e->getMessage(), "\n";
}
try {
unset($ao[[]]);
} catch (TypeError $e) {
echo $e->getMessage(), "\n";
}
?>
--EXPECT--
Illegal offset type
Illegal offset type
Illegal offset type
Illegal offset type in isset or empty
Illegal offset type in unset