3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $hexColor = '012'; $color = implode('', array_map(function($color){ return str_repeat($color, 2); }, str_split($hexColor))); echo $color; echo PHP_EOL; print_r( array( 'R' => hexdec($color[0] . $color[1]), 'G' => hexdec($color[2] . $color[3]), 'B' => hexdec($color[4] . $color[5]), ) ); sscanf($color, '%02x%02x%02x', $RGB['R'], $RGB['G'], $RGB['B']); print_r( $RGB ); echo PHP_EOL;
based on NL9Xa