3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace HHVM\UserDocumentation\Inconsistencies\Intro\Examples\AIC; $x = [0, 1]; next($x); // internal array cursor points at 1 next($x); // internal array cursor points after last element $y = $x; $y[] = 2; // Triggers copy-on-write var_dump(current($x)); // bool(false) var_dump(current($y)); // int(2) on HHVM, int(0) on PHP

preferences:
56.46 ms | 402 KiB | 5 Q