1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 08:12:21 +01:00
Files
archived-php-src/ext/spl/tests/fixedarray_006.phpt
George Peter Banyard e9e06279c1 Refactor SplFixedArray (#7168)
* Move spl_offset_convert_to_long() to spl_fixedarray.c

It is only used there, which explains its weird offset semantics

* Refactor SplFixedArray offset handling
- Implement warning for resource type
- Throw a proper TypeError instead of a RuntimeException

* Use a proper Error to signal that [] cannot be used with SplFixedArray

* Refactor SplFixedArray has_dimension helper

* Drop some ZPP tests
2021-06-18 15:22:52 +01:00

23 lines
310 B
PHP

--TEST--
SPL: FixedArray: Assigning objects
--FILE--
<?php
$b = 10000;
$a = new SplFixedArray($b);
try {
for ($i = 0; $i < 100; $i++) {
$a[] = new stdClass;
}
} catch (Error $e) {
echo $e->getMessage(), "\n";
}
print "ok\n";
?>
--EXPECT--
[] operator not supported for SplFixedArray
ok