3v4l.org

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