3v4l.org

run code in 300+ PHP versions simultaneously
<?php $x = false; (function () use ($x) { $x = true; })(); var_dump( $x );
based on XWUDg
Output for 7.0.0 - 7.0.24, 7.1.0 - 7.1.25, 7.2.0 - 7.2.33, 7.3.0 - 7.3.27, 7.4.0 - 7.4.16, 8.0.0 - 8.0.3
bool(false)