3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php setlocale(LC_COLLATE, 'de_DE.UTF-8', 'de_DE@euro', 'de_DE', 'deu_deu'); var_dump(PHP_VERSION); function test($a, $b) { if (version_compare(PHP_VERSION, '7.0', '>=')) { return $a <=> $b; } return strcoll($a, $b); } test('a', 'b');
based on rENq5
Output for 7.3.0alpha1
string(11) "7.3.0alpha1"
Output for 7.2.6
string(5) "7.2.6"
Output for 7.2.5
string(5) "7.2.5"
Output for 7.1.7
string(5) "7.1.7"
Output for 7.1.6
string(5) "7.1.6"
Output for 7.1.5
string(5) "7.1.5"
Output for 7.1.4
string(5) "7.1.4"
Output for 7.1.3
string(5) "7.1.3"
Output for 7.1.2
string(5) "7.1.2"
Output for 7.1.1
string(5) "7.1.1"
Output for 7.1.0
string(5) "7.1.0"
Output for 7.0.20
string(6) "7.0.20"
Output for 7.0.19
string(6) "7.0.19"
Output for 7.0.18
string(6) "7.0.18"
Output for 7.0.17
string(6) "7.0.17"
Output for 7.0.16
string(6) "7.0.16"
Output for 7.0.15
string(6) "7.0.15"
Output for 7.0.14
string(6) "7.0.14"
Output for 7.0.13
string(6) "7.0.13"
Output for 7.0.12
string(6) "7.0.12"
Output for 7.0.11
string(6) "7.0.11"
Output for 7.0.10
string(6) "7.0.10"
Output for 7.0.9
string(5) "7.0.9"
Output for 7.0.8
string(5) "7.0.8"
Output for 7.0.7
string(5) "7.0.7"
Output for 7.0.6
string(5) "7.0.6"
Output for 7.0.5
string(5) "7.0.5"
Output for 7.0.4
string(5) "7.0.4"
Output for 7.0.3
string(5) "7.0.3"
Output for 7.0.2
string(5) "7.0.2"
Output for 7.0.1
string(5) "7.0.1"
Output for 7.0.0
string(5) "7.0.0"
Output for hhvm-3.15.4
string(11) "7.0.99-hhvm"
Output for 5.6.0 - 5.6.30
Parse error: syntax error, unexpected '>' in /in/mJHqN on line 8
Process exited with code 255.