3v4l.org

run code in 300+ PHP versions simultaneously
<?php $data = array_map( Closure::fromCallable('trim'), [' x', 'z '] ); var_dump($data);
Output for 8.2.0 - 8.2.27, 8.3.0 - 8.3.16, 8.4.1 - 8.4.3
array(2) { [0]=> string(1) "x" [1]=> string(1) "z" }

preferences:
42.84 ms | 406 KiB | 5 Q