3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $config = array( 'key' => array( '/text/' => '/main/') ); $dataKey='/chat/'; foreach ($config['key'] as $url => $key) { $quoted = preg_quote($url, '/'); if (null !== $res = preg_replace('/' . $quoted . '/', $key, $dataKey)) { var_dump( $res ); } }
Output for 5.5.31 - 7.2.0
string(6) "/chat/"