3v4l.org

run code in 300+ PHP versions simultaneously
<?php $grades = array( "PK", "K", "01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12" ); function normalizeLexileScore($ability, $grade_level = null) { echo (int)$grade_level; if( $grade_level == null ) { return $ability; } $grade_level = max(min($grade_level, 9), 2); echo " > $grade_level\n"; $gli_cap = array(NULL, NULL, 975, 1070, 1165, 1250, 1300, 1370, 1420, 1500); $normalized = min($ability, $gli_cap[$grade_level]); return $normalized; } foreach ($grades as $grade) { printf("%d, %s\n", normalizeLexileScore(1000, $grade), $grade); }
Output for git.master, git.master_jit, rfc.property-hooks
0 > 9 1000, PK 0 > 9 1000, K 1 > 2 975, 01 2 > 02 Warning: Undefined array key "02" in /in/MTIQG on line 32 0, 02 3 > 03 Warning: Undefined array key "03" in /in/MTIQG on line 32 0, 03 4 > 04 Warning: Undefined array key "04" in /in/MTIQG on line 32 0, 04 5 > 05 Warning: Undefined array key "05" in /in/MTIQG on line 32 0, 05 6 > 06 Warning: Undefined array key "06" in /in/MTIQG on line 32 0, 06 7 > 07 Warning: Undefined array key "07" in /in/MTIQG on line 32 0, 07 8 > 08 Warning: Undefined array key "08" in /in/MTIQG on line 32 0, 08 9 > 09 Warning: Undefined array key "09" in /in/MTIQG on line 32 0, 09 10 > 9 1000, 10 11 > 9 1000, 11 12 > 9 1000, 12

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
48.33 ms | 402 KiB | 8 Q