mirror of
https://github.com/php/php-src.git
synced 2026-03-24 00:02:20 +01:00
* 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
22 lines
310 B
PHP
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
|