3v4l.org

run code in 300+ PHP versions simultaneously
<?php $sks = 12; $kurang = array(0,11,11.999); $cukup = array(11,11.999,16.111); $lebih = array(11.999,16.111,20); $kb = array_intersect($kurang, $cukup); $bp = array_intersect($cukup, $lebih); if ( $sks >= $bp [1]) { $muCukup = ($sks >= $bp[2]) ? "0" : ($sks <= $bp[2] ? ($sks - $kb[1]) / ($kb[2] - $kb[1]) : "0.5" ); $muLebih = ($sks - $bp[1]) / ($bp[2] - $bp[1]); if ($muLebih > $muCukup) { echo "Beban Berlebih"; } else { echo "Beban Cukup"; } } elseif ($sks < $kb [2] ) { $muKurang = ($kb[2] - $sks) / ($kb[2] - $kb[1]); $muCukup = ($sks - $kb[1]) / ($kb[2] - $kb[1]); if ($muKurang > $muCukup) { echo "Beban Kurang"; } else { echo "Beban Cukup"; } }

preferences:
34.58 ms | 402 KiB | 5 Q