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 $lumOne - $lumTwo; } ) var_dump($colors);
Output for 5.4.0 - 5.4.22
Parse error: syntax error, unexpected 'var_dump' (T_STRING) in /in/V0eov on line 28
Process exited with code 255.
Output for 5.3.0 - 5.3.27
Parse error: syntax error, unexpected T_STRING in /in/V0eov on line 28
Process exited with code 255.