3v4l.org

run code in 200+ php & hhvm versions
```<?php \$hasil = 17; \$kecewa = array(0,7,14); \$biasa = array(21,14,20); \$puas = array(14,20,100); \$kb = array_intersect(\$kecewa, \$biasa); \$bp = array_intersect(\$biasa, \$puas); print_r(\$kb); print_r(\$bp); // antara 65 - 80 if ( \$hasil >= \$bp[1] && \$hasil <= \$bp[2] ) { \$muBiasa = (\$hasil >= \$bp[2]) ? "0" : (\$hasil <= \$bp[2] ? (\$hasil - \$kb[1]) / (\$kb[2] - \$kb[1]) : "0.5" ); \$muPuas = (\$hasil - \$bp[1]) / (\$bp[2] - \$bp[1]); echo " muPuas " .\$muPuas; echo " muBiasa " .\$muBiasa; } // antara 40 - 65 elseif ( \$hasil >= \$kb[1] && \$hasil < \$kb[2] ) { \$muKecewa = (\$kb[2] - \$hasil) / (\$kb[2] - \$kb[1]); \$muBiasa = (\$hasil - \$kb[1]) / (\$kb[2] - \$kb[1]); echo "muKecewa " .\$muKecewa; echo "muBias " .\$muBiasa; }```
Output for 5.3.0 - 7.2.0
Array ( [2] => 14 ) Array ( [1] => 14 [2] => 20 ) Notice: Undefined offset: 1 in /in/t7tha on line 17 Notice: Undefined offset: 1 in /in/t7tha on line 17 muPuas 0.5 muBiasa 1.2142857142857
Output for 4.3.0 - 5.2.17
Array ( [2] => 14 ) Array ( [1] => 14 [2] => 20 ) Notice: Undefined offset: 1 in /in/t7tha on line 17 Notice: Undefined offset: 1 in /in/t7tha on line 17 muPuas 0.5 muBiasa 1.2142857142857