3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $colors = array( array(0,0,0), array(255,0,0), array(0,255,0), array(0,0,255), array(255,255,0), array(0,255,255), array(255,0,255), array(192,192,192), array(255,255,255) ); function colorToLum($r, $g, $b) { return (0.299 * $r + 0.587 * $g + 0.114 * $g) } usort( $colors, function ($one, $two) { $lumOne = colorToLum($one[0], $one[1], $one[2]); $lumTwo = colorToLum($two[0], $two[1], $two[2]); return $lumTwo - $lumOne; } ) var_dump($colors);
Output for 5.3.0 - 5.4.22
Parse error: syntax error, unexpected '}' in /in/6K7WJ on line 17
Process exited with code 255.