3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $client_version_header = '1.5'; $oldVersion = false; if(!$client_version_header){ $oldVersion = true; } else { $splitted = explode('.', $client_version_header); $major = $splitted[0]; $minor = $splitted[1]; if($major < 1){ $oldVersion = true; } if($major == 1 && $minor < 5){ $oldVersion = true; } } if($oldVersion) { echo 'oldversion'; } else { echo 'newVersion'; }
based on 8kt3F
Output for 4.3.0 - 7.2.0
newVersion