3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $versions = array( '1', '1.0', '1.01', '1.1', '1.10', '1.10b', '1.10.0', ); $comps = array( -1 => 'lt', 0 => 'eq', 1 => 'gt' ); foreach ($versions as $version) { if (isset($last)) { $comp = version_compare($last, $version); echo str_pad($last,8,' ',STR_PAD_LEFT) . " {$comps[$comp]} {$version}\n"; } $last = $version; }
Output for 4.3.0 - 5.6.28, hhvm-3.12.0, 7.0.0 - 7.1.0
1 lt 1.0 1.0 lt 1.01 1.01 eq 1.1 1.1 lt 1.10 1.10 gt 1.10b 1.10b lt 1.10.0
Output for hhvm-3.10.0

Process exited with code 153.