3v4l.org

run code in 300+ PHP versions simultaneously
<?php declare(strict_types=1); function foo (string $bar = null ): string { echo 'test' }; foo(); foo(null); foo('100');
Output for 5.5.24 - 5.5.30, 5.6.8 - 5.6.15
Warning: Unsupported declare 'strict_types' in /in/Yuj4l on line 3 Parse error: syntax error, unexpected ':', expecting '{' in /in/Yuj4l on line 6
Process exited with code 255.

preferences:
206.16 ms | 1399 KiB | 22 Q