3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $str = 'dd-mm-yyyy'; $count = 1; var_dump(str_replace(array('dd', 'd', 'mmmm', 'mmm', 'mm', 'm', 'yyyy', 'yy'), array('d', 'j', 'F', 'M', 'm', 'n', 'Y', 'y'), $str, $count)); var_dump($count);
based on RdTLo
Output for 5.0.0 - 7.2.0
string(5) "j-n-Y" int(5)
Output for 4.3.2 - 4.4.9
Warning: Wrong parameter count for str_replace() in /in/XSBsU on line 5 NULL int(1)
Output for 4.3.0 - 4.3.1
string(5) "j-n-Y" int(1)