3v4l.org

run code in 300+ PHP versions simultaneously
<?php class my_ite implements Iterator { public function current() { return 1; } public function key() { return 1; } public function next() { // do something. } public function rewind() { // do something. } public function valid() { return true; } }
Output for 8.1.0 - 8.1.34, 8.2.0 - 8.2.30, 8.3.0 - 8.3.30, 8.4.1 - 8.4.18, 8.5.0 - 8.5.3
Deprecated: Return type of my_ite::current() should either be compatible with Iterator::current(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /in/bPN2V on line 4 Deprecated: Return type of my_ite::next() should either be compatible with Iterator::next(): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /in/bPN2V on line 10 Deprecated: Return type of my_ite::key() should either be compatible with Iterator::key(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /in/bPN2V on line 7 Deprecated: Return type of my_ite::valid() should either be compatible with Iterator::valid(): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /in/bPN2V on line 16 Deprecated: Return type of my_ite::rewind() should either be compatible with Iterator::rewind(): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /in/bPN2V on line 13
Output for 7.4.0 - 7.4.33, 8.0.1 - 8.0.30

preferences:
95.2 ms | 1385 KiB | 4 Q