<?php
class SpecialArray implements \ArrayAccess
{
public function offsetExists($index){}
public function offsetGet($index){}
public function offsetSet($index, $value){}
public function offsetUnset($index){}
}
$arr = new SpecialArray;
$arr[] = 1;
$arr[] = 2;
$arr[] = 3;
var_dump(count($arr));
Deprecated: Return type of SpecialArray::offsetExists($index) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /in/G0pR3 on line 5
Deprecated: Return type of SpecialArray::offsetGet($index) should either be compatible with ArrayAccess::offsetGet(mixed $offset): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /in/G0pR3 on line 6
Deprecated: Return type of SpecialArray::offsetSet($index, $value) should either be compatible with ArrayAccess::offsetSet(mixed $offset, mixed $value): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /in/G0pR3 on line 7
Deprecated: Return type of SpecialArray::offsetUnset($index) should either be compatible with ArrayAccess::offsetUnset(mixed $offset): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /in/G0pR3 on line 8
Fatal error: Uncaught TypeError: count(): Argument #1 ($value) must be of type Countable|array, SpecialArray given in /in/G0pR3:16
Stack trace:
#0 {main}
thrown in /in/G0pR3 on line 16
Process exited with code 255.
Output for 8.3.5
Warning: PHP Startup: Unable to load dynamic library 'sodium.so' (tried: /usr/lib/php/8.3.5/modules/sodium.so (libsodium.so.23: cannot open shared object file: No such file or directory), /usr/lib/php/8.3.5/modules/sodium.so.so (/usr/lib/php/8.3.5/modules/sodium.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
Deprecated: Return type of SpecialArray::offsetExists($index) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /in/G0pR3 on line 5
Deprecated: Return type of SpecialArray::offsetGet($index) should either be compatible with ArrayAccess::offsetGet(mixed $offset): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /in/G0pR3 on line 6
Deprecated: Return type of SpecialArray::offsetSet($index, $value) should either be compatible with ArrayAccess::offsetSet(mixed $offset, mixed $value): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /in/G0pR3 on line 7
Deprecated: Return type of SpecialArray::offsetUnset($index) should either be compatible with ArrayAccess::offsetUnset(mixed $offset): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /in/G0pR3 on line 8
Fatal error: Uncaught TypeError: count(): Argument #1 ($value) must be of type Countable|array, SpecialArray given in /in/G0pR3:16
Stack trace:
#0 {main}
thrown in /in/G0pR3 on line 16
Process exited with code 255.
Output for 8.0.10 - 8.0.30
Fatal error: Uncaught TypeError: count(): Argument #1 ($value) must be of type Countable|array, SpecialArray given in /in/G0pR3:16
Stack trace:
#0 {main}
thrown in /in/G0pR3 on line 16
Process exited with code 255.
Output for 8.0.0 - 8.0.9
Fatal error: Uncaught TypeError: count(): Argument #1 ($var) must be of type Countable|array, SpecialArray given in /in/G0pR3:16
Stack trace:
#0 {main}
thrown in /in/G0pR3 on line 16
Process exited with code 255.