3v4l.org

run code in 150+ 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 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.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