3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $color = 'FF1122'; 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]), ) ); $test = sscanf($color, '%02x%02x%02x', $RGB['R'], $RGB['G'], $RGB['B']); var_dump($test); print_r( $RGB ); echo PHP_EOL;
based on 6bU7I
Output for 4.3.10 - 4.4.9, 5.0.2 - 7.2.0
FF1122 Array ( [R] => 255 [G] => 17 [B] => 34 ) int(3) Array ( [R] => 255 [G] => 17 [B] => 34 )
Output for 4.3.0 - 4.3.9, 5.0.0 - 5.0.1
FF1122 Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/UALqa on line 6 PHP_EOLArray ( [R] => 255 [G] => 17 [B] => 34 ) int(3) Array ( [R] => 255 [G] => 17 [B] => 34 ) Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/UALqa on line 18 PHP_EOL