3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function roman_number($N) { $c = 'IVXLCDM'; for ($a = 5, $b = $s = ''; $N; $b++, $a ^= 7) for ($o = $N % $a, $N = $N / $a ^ 0; $o--; $s = $c[($o > 2 ? $b + $N - ($N &= -2) + $o = 1 : $b) || 0] . $s) ; return $s; } echo roman_number(542);
based on rpWdu
Output for 5.4.5 - 7.2.0
Notice: String offset cast occurred in /in/72jQ2 on line 6 Notice: String offset cast occurred in /in/72jQ2 on line 6 Notice: String offset cast occurred in /in/72jQ2 on line 6 Notice: String offset cast occurred in /in/72jQ2 on line 6 Notice: String offset cast occurred in /in/72jQ2 on line 6 VVVII
Output for 5.4.0 - 5.4.4
Notice: String offset cast occured in /in/72jQ2 on line 6 Notice: String offset cast occured in /in/72jQ2 on line 6 Notice: String offset cast occured in /in/72jQ2 on line 6 Notice: String offset cast occured in /in/72jQ2 on line 6 Notice: String offset cast occured in /in/72jQ2 on line 6 VVVII
Output for 4.3.0 - 5.3.29
VVVII