3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace Foo { use function random_int; var_dump(random_int(1, 100)); var_dump(\random_int(1, 100)); } namespace Foo { function random_int(int $min, int $max) : int { return 4; } }
Output for 7.2.0
int(77) int(86)
Output for 7.1.7
int(54) int(88)
Output for 7.1.6
int(78) int(3)
Output for 7.1.5
int(27) int(38)
Output for 7.1.0
int(13) int(34)
Output for 7.0.20
int(60) int(3)
Output for 7.0.6
int(18) int(55)
Output for 7.0.5
int(80) int(47)
Output for 7.0.4
int(31) int(37)
Output for 7.0.3
int(95) int(54)
Output for 7.0.2
int(61) int(73)
Output for 7.0.1
int(83) int(46)
Output for 7.0.0
int(17) int(86)
Output for 5.6.8 - 5.6.28
Parse error: syntax error, unexpected ':', expecting '{' in /in/cR6Gg on line 8
Process exited with code 255.
Output for 5.5.24 - 5.5.35
Parse error: syntax error, unexpected 'function' (T_FUNCTION), expecting identifier (T_STRING) or \\ (T_NS_SEPARATOR) in /in/cR6Gg on line 3
Process exited with code 255.

preferences:
54.09 ms | 424 KiB | 5 Q