3v4l.org

run code in 300+ PHP versions simultaneously
<?php declare(strict_types=1); function foo($x, &$y) { $y = $x ** 2; return $x * 2; } $a = 100; var_dump([foo(5, $a), $a]);
Output for 8.2.0 - 8.2.29, 8.3.0 - 8.3.25, 8.4.1 - 8.4.12
array(2) { [0]=> int(10) [1]=> int(25) }

preferences:
41.34 ms | 406 KiB | 5 Q