3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $hasil = 0; $kurang = array(0,12); $cukup = array(12,16); $berlebih = array(16,20); $kb = array_intersect($kurang, $cukup); $bp = array_intersect($cukup, $berlebih); print_r($kc); print_r($cb); // antara 12-16 if ( $hasil >= $cb[1] && $hasil <= $cb[2] ) { $muCukup = ($hasil >= $cb[2]) ? "0" : ($hasil <= $cb[2] ? ($hasil - $kc[1]) / ($kc[2] - $kc[1]) : "0.5" ); $muBerlebih = ($hasil - $cb[1]) / ($cb[2] - $cb[1]); echo " muPuas " .$muBerlebih; echo " muBiasa " .$muCukup; } // antara 0-12 elseif ( $hasil >= $kc[1] && $hasil < $kc[2] ) { $muKurang = ($kc[2] - $hasil) / ($kc[2] - $kc[1]); $muCukup = ($hasil - $kc[1]) / ($kc[2] - $kc[1]); echo "muKecewa " .$muKurang; echo "muBias " .$muCukup; }
Output for hhvm-3.12.0, 7.0.0 - 7.1.0
Notice: Undefined variable: kc in /in/Ak5ph on line 10 Notice: Undefined variable: cb in /in/Ak5ph on line 11 Notice: Undefined variable: cb in /in/Ak5ph on line 14 Notice: Undefined variable: cb in /in/Ak5ph on line 14 Notice: Undefined variable: cb in /in/Ak5ph on line 17 Notice: Undefined variable: cb in /in/Ak5ph on line 18 Notice: Undefined variable: cb in /in/Ak5ph on line 18 Notice: Undefined variable: cb in /in/Ak5ph on line 18 Warning: Division by zero in /in/Ak5ph on line 18 muPuas NAN muBiasa 0
Output for 5.0.4 - 5.6.28, hhvm-3.10.0
Notice: Undefined variable: kc in /in/Ak5ph on line 10 Notice: Undefined variable: cb in /in/Ak5ph on line 11 Notice: Undefined variable: cb in /in/Ak5ph on line 14 Notice: Undefined variable: cb in /in/Ak5ph on line 14 Notice: Undefined variable: cb in /in/Ak5ph on line 17 Notice: Undefined variable: cb in /in/Ak5ph on line 18 Notice: Undefined variable: cb in /in/Ak5ph on line 18 Notice: Undefined variable: cb in /in/Ak5ph on line 18 Warning: Division by zero in /in/Ak5ph on line 18 muPuas muBiasa 0
Output for 4.3.0 - 5.0.3
Notice: Undefined variable: kc in /in/Ak5ph on line 10 Notice: Undefined variable: cb in /in/Ak5ph on line 11 Notice: Undefined variable: cb in /in/Ak5ph on line 14 Notice: Undefined variable: cb in /in/Ak5ph on line 14 Notice: Undefined variable: cb in /in/Ak5ph on line 17 Notice: Undefined variable: cb in /in/Ak5ph on line 18 Notice: Undefined variable: cb in /in/Ak5ph on line 18 Notice: Undefined variable: cb in /in/Ak5ph on line 18 Warning: Division by zero in /in/Ak5ph on line 18 muPuas muBiasa 0