3v4l.org

run code in 300+ PHP versions simultaneously
<?php function HSL2RGB($h, $s, $l) { $s = max(0, min($s, 100)); $l = max(0, min($l, 100)); $s = $s/100; $l = $l/100; $h = $h >= 360 ? $h % 360 : $h; $c = ( 1 - abs( 2 * $l - 1 ) ) * $s; $x = $c * ( 1 - abs( fmod( ( $h / 60 ), 2 ) - 1 ) ); $m = $l - ( $c / 2 ); if ( $h < 60 ) { $r = $c; $g = $x; $b = 0; } else if ( $h < 120 ) { $r = $x; $g = $c; $b = 0; } else if ( $h < 180 ) { $r = 0; $g = $c; $b = $x; } else if ( $h < 240 ) { $r = 0; $g = $x; $b = $c; } else if ( $h < 300 ) { $r = $x; $g = 0; $b = $c; } else { $r = $c; $g = 0; $b = $x; } $r = ( $r + $m ) * 255; $g = ( $g + $m ) * 255; $b = ( $b + $m ) * 255; return [$r, $g, $b]; } print_r(HSL2RGB(55, 99, 100));
Output for git.master, git.master_jit, rfc.property-hooks
Array ( [0] => 255 [1] => 255 [2] => 255 )

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:
57.95 ms | 401 KiB | 8 Q