3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function rome($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].$s); return $s; } $some_string = "1"; echo rome($some_string);
Output for 5.4.0 - 5.6.28, 7.0.0 - 7.1.0
Warning: Illegal string offset '' in /in/1MGIS on line 5 I
Output for 4.3.0 - 5.3.29, hhvm-3.10.0 - 3.12.0
I