3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $string = '[Salut] [toi][,] [├ža] [va] [?]'; $regex = '/\[.*\]/im'; preg_replace($regex, '$1', $new_string); var_dump($new_string);
based on t0WMD
Output for 5.0.4 - 7.2.0
Notice: Undefined variable: new_string in /in/qjPqR on line 5 Notice: Undefined variable: new_string in /in/qjPqR on line 7 NULL
Output for 4.3.0 - 5.0.3
Notice: Undefined variable: new_string in /in/qjPqR on line 5 Notice: Undefined variable: new_string in /in/qjPqR on line 7 NULL