3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo extends IteratorIterator { function __construct( $items ) { if ( is_array( $items ) ) { $items = new ArrayIterator( $items ); } } function __debugInfo() { throw new \Exception(); return [ "count" => iterator_count( $this ) ]; } } $a = new Foo( [ 1,2,3 ] ); var_dump( $a ); ?>

This is an error 500

Value for `_results` contains invalid data `array`


preferences:
172.04 ms | 2276 KiB | 11 Q