3v4l.org

run code in 200+ 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 - 7.2.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