3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $width = 300; $height = 150; $ratio = "2/1"; var_export( sscanf($ratio, '%d/%d') ); list($numerator, $denominator) = array_pad(sscanf($ratio, '%d/%d'), 2, 1); echo $numerator / $denominator == $width / $height ? 'true' : 'false';
based on 0uIu9
Output for 5.5.0 - 7.2.8
array ( 0 => 2, 1 => 1, )true