3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = ['contact', 'home', 'projects']; [$a[0], $a[1]] = [$a[1], $a[0]]; var_export($a);
Output for 7.2.0 - 7.2.31, 7.3.0 - 7.3.19, 7.4.0 - 7.4.7, 8.0.0alpha1 - alpha2
array ( 0 => 'home', 1 => 'contact', 2 => 'projects', )