3v4l.org

run code in 300+ PHP versions simultaneously
<?php function ip_clean(string $ip) : ?string { return implode( '.', array_map( function ($el) { return (int) $el; }, explode('.', $ip) ) ); } echo ip_clean('195.194.213.096'), PHP_EOL;
Output for 7.1.0, 7.2.29 - 7.2.33, 7.3.16 - 7.3.33, 7.4.3 - 7.4.30, 8.0.0 - 8.0.23, 8.1.0 - 8.1.10
195.194.213.96
Output for 7.0.0 - 7.0.8
Parse error: syntax error, unexpected '?' in /in/NcNg7 on line 3
Process exited with code 255.
Output for 5.5.0 - 5.5.37, 5.6.0 - 5.6.23
Parse error: syntax error, unexpected ':', expecting '{' in /in/NcNg7 on line 3
Process exited with code 255.

preferences:
52.37 ms | 411 KiB | 5 Q