- var_dump: documentation ( source)
- microtime: documentation ( source)
- strtr: documentation ( source)
- str_replace: documentation ( source)
- printf: documentation ( source)
<?php
$var = 'React/Controller/Website/User';
$s = microtime(true);
for ($i = 0; $i < 1000; $i++)
$result = strtr($var, '/', '_');
printf('%.09f', microtime(true) - $s);
var_dump($result);
echo "\n";
$s = microtime(true);
for ($i = 0; $i < 1000; $i++)
$result = str_replace('/', '_', $var);
printf('%.09f', microtime(true) - $s);
var_dump($result);