3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $width = 300; $height = 150; $ratio = "2/1"; echo sscanf($ratio, '%d/%d'); list($numerator, $denominator) = array_pad(sscanf($ratio, '%d/%d'), 2, 1); echo $numerator / $denominator == $width / $height ? 'true' : 'false';
based on eM738
Output for 5.5.0 - 7.2.6
Notice: Array to string conversion in /in/0uIu9 on line 8 Arraytrue