3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $cookie=" CBSESSID=j8898hekkp2kavopnctmbq8cfgk39jmd; path=/ "; $cookie = preg_replace( '/CBSESSID=/', '', $cookie ); $cookie = preg_replace( '/ path=\//', '', $cookie ); var_dump( $cookie ); $cookie = preg_replace( '/;/', '', trim($cookie) ); var_dump( $cookie );
based on u7RrD
Output for 4.3.0 - 5.6.28, hhvm-3.12.0, 7.0.0 - 7.1.0
string(37) " j8898hekkp2kavopnctmbq8cfgk39jmd; " string(32) "j8898hekkp2kavopnctmbq8cfgk39jmd"
Output for hhvm-3.10.0

Process exited with code 153.