3v4l.org

run code in 200+ PHP versions simultaneously
<?php $x = false; $y = (function () use ($x) { $x = true; }); $y(); var_dump( $x );
based on uXhtd
Output for 5.6.0 - 7.2.6
bool(false)