3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $string = "/companies/(\d+)/adverts/new/(\d+)"; $result = vsprintf(preg_replace('#\((.*?)\)#', '%s', $string, -1, $count), $replace); var_dump($result);
Output for 5.1.3 - 5.6.28, 7.0.0 - 7.1.0
Notice: Undefined variable: replace in /in/9sABS on line 4 Warning: vsprintf(): Too few arguments in /in/9sABS on line 4 bool(false)
Output for hhvm-3.10.0 - 3.12.0
Notice: Undefined variable: replace in /in/9sABS on line 4 Warning: Invalid argument: arguments: (too few) in /in/9sABS on line 4 bool(false)
Output for 5.1.0 - 5.1.2
Notice: Undefined variable: count in /in/9sABS on line 4 Notice: Undefined variable: replace in /in/9sABS on line 4 Warning: vsprintf(): Too few arguments in /in/9sABS on line 4 bool(false)
Output for 5.0.4 - 5.0.5
Notice: Undefined variable: count in /in/9sABS on line 4 Warning: Wrong parameter count for preg_replace() in /in/9sABS on line 4 Notice: Undefined variable: replace in /in/9sABS on line 4 string(0) ""
Output for 4.3.0 - 5.0.3
Notice: Undefined variable: count in /in/9sABS on line 4 Warning: Wrong parameter count for preg_replace() in /in/9sABS on line 4 Notice: Undefined variable: replace in /in/9sABS on line 4 string(0) ""