3v4l.org

run code in 300+ PHP versions simultaneously
<?php echo PHP_VERSION; if (version_compare(PHP_VERSION, '7.0', '>=')) { declare(strict_types=1); function foo(int $foo) { echo $foo; } foo(1); foo('hi'); }
Output for 7.0.0
Fatal error: strict_types declaration must be the very first statement in the script in /in/d4BVO on line 6
Process exited with code 255.
Output for 5.6.28
Warning: Unsupported declare 'strict_types' in /in/d4BVO on line 6 5.6.28
Output for 5.6.21
Warning: Unsupported declare 'strict_types' in /in/d4BVO on line 6 5.6.21
Output for 5.6.20
Warning: Unsupported declare 'strict_types' in /in/d4BVO on line 6 5.6.20
Output for 5.6.19
Warning: Unsupported declare 'strict_types' in /in/d4BVO on line 6 5.6.19
Output for 5.6.18
Warning: Unsupported declare 'strict_types' in /in/d4BVO on line 6 5.6.18
Output for 5.6.17
Warning: Unsupported declare 'strict_types' in /in/d4BVO on line 6 5.6.17
Output for 5.6.16
Warning: Unsupported declare 'strict_types' in /in/d4BVO on line 6 5.6.16
Output for 5.6.15
Warning: Unsupported declare 'strict_types' in /in/d4BVO on line 6 5.6.15
Output for 5.6.14
Warning: Unsupported declare 'strict_types' in /in/d4BVO on line 6 5.6.14
Output for 5.6.13
Warning: Unsupported declare 'strict_types' in /in/d4BVO on line 6 5.6.13
Output for 5.6.12
Warning: Unsupported declare 'strict_types' in /in/d4BVO on line 6 5.6.12
Output for 5.6.11
Warning: Unsupported declare 'strict_types' in /in/d4BVO on line 6 5.6.11
Output for 5.6.10
Warning: Unsupported declare 'strict_types' in /in/d4BVO on line 6 5.6.10
Output for 5.6.9
Warning: Unsupported declare 'strict_types' in /in/d4BVO on line 6 5.6.9
Output for 5.6.8
Warning: Unsupported declare 'strict_types' in /in/d4BVO on line 6 5.6.8
Output for 5.5.35
Warning: Unsupported declare 'strict_types' in /in/d4BVO on line 6 5.5.35
Output for 5.5.34
Warning: Unsupported declare 'strict_types' in /in/d4BVO on line 6 5.5.34
Output for 5.5.33
Warning: Unsupported declare 'strict_types' in /in/d4BVO on line 6 5.5.33
Output for 5.5.32
Warning: Unsupported declare 'strict_types' in /in/d4BVO on line 6 5.5.32
Output for 5.5.31
Warning: Unsupported declare 'strict_types' in /in/d4BVO on line 6 5.5.31
Output for 5.5.30
Warning: Unsupported declare 'strict_types' in /in/d4BVO on line 6 5.5.30
Output for 5.5.29
Warning: Unsupported declare 'strict_types' in /in/d4BVO on line 6 5.5.29
Output for 5.5.28
Warning: Unsupported declare 'strict_types' in /in/d4BVO on line 6 5.5.28
Output for 5.5.27
Warning: Unsupported declare 'strict_types' in /in/d4BVO on line 6 5.5.27
Output for 5.5.26
Warning: Unsupported declare 'strict_types' in /in/d4BVO on line 6 5.5.26
Output for 5.5.25
Warning: Unsupported declare 'strict_types' in /in/d4BVO on line 6 5.5.25
Output for 5.5.24
Warning: Unsupported declare 'strict_types' in /in/d4BVO on line 6 5.5.24

preferences:
174.88 ms | 1395 KiB | 35 Q