1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00
Files
archived-php-src/ext/spl/tests/fixedarray_013.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

22 lines
310 B
PHP

--TEST--
SPL: FixedArray: Passing the object using [] as parameter
--FILE--
<?php
$a = new SplFixedArray(100);
function test(SplFixedArray &$arr) {
print "ok\n";
}
try {
test($a[]);
} catch (\Error $e) {
echo $e->getMessage(), "\n";
}
?>
--EXPECT--
[] operator not supported for SplFixedArray