3v4l.org

run code in 300+ PHP versions simultaneously
<?php $params = [ 'subject' => 'Hello 7', // normally third parameter 'pattern' => '/[a-z ]/', // normally first parameter // 'limit' // normally fourth parameter, omitted for this demonstration; the default -1 will be used 'count' => &$counted, // normally fifth parameter // ^-- don't forget to make it modifiable! 'replacement' => '', // normally second parameter ]; echo preg_replace(...$params) . "\n" . $counted;

preferences:
26.27 ms | 404 KiB | 5 Q