3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $main_url_host = 'main.example.com'; $current_url_host = 'sub.example.com'; preg_match('~(.+)*\.' . $main_url_host. '$~', $current_url_host, $matches ); var_dump($matches[1]);
Output for 5.6.30, 7.0.0 - 7.3.0rc3
Notice: Undefined offset: 1 in /in/UBXHC on line 7 NULL
Output for hhvm-3.22.0
Notice: Undefined index: 1 in /in/UBXHC on line -1 NULL
Output for hhvm-3.15.4 - 3.21.3
Notice: Undefined index: 1 in /in/UBXHC on line 7 NULL