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) { 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
> 9 1000, PK > 9 1000, K > 2 975, 01 > 02 Warning: Undefined array key "02" in /in/jNFqG on line 30 0, 02 > 03 Warning: Undefined array key "03" in /in/jNFqG on line 30 0, 03 > 04 Warning: Undefined array key "04" in /in/jNFqG on line 30 0, 04 > 05 Warning: Undefined array key "05" in /in/jNFqG on line 30 0, 05 > 06 Warning: Undefined array key "06" in /in/jNFqG on line 30 0, 06 > 07 Warning: Undefined array key "07" in /in/jNFqG on line 30 0, 07 > 08 Warning: Undefined array key "08" in /in/jNFqG on line 30 0, 08 > 09 Warning: Undefined array key "09" in /in/jNFqG on line 30 0, 09 > 9 1000, 10 > 9 1000, 11 > 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:
37.34 ms | 402 KiB | 8 Q