3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [1,2,3]; $iterator = (new ArrayObject($array))->getIterator(); var_dump(current($iterator));
Output for 8.1.0 - 8.1.6
Deprecated: current(): Calling current() on an object is deprecated in /in/KZg3c on line 7 bool(false)
Output for 7.4.0 - 7.4.29, 8.0.0 - 8.0.19
bool(false)
Output for 7.1.25 - 7.1.28, 7.2.0 - 7.2.33, 7.3.0 - 7.3.33
int(1)

preferences:
58.29 ms | 411 KiB | 5 Q