3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $class = 'Zend\Ha\Heee'; $matches = array(); preg_match('/(?P<namespace>.+\\\)?(?P<class>[^\\\]+$)/', $class, $matches); $class = (isset($matches['class'])) ? $matches['class'] : ''; $namespace = (isset($matches['namespace'])) ? $matches['namespace'] : ''; var_dump($mayches, $class, $namespace);
Output for 5.0.4 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
Notice: Undefined variable: mayches in /in/lCjMh on line 9 NULL string(4) "Heee" string(8) "Zend\Ha\"
Output for 4.3.3 - 5.0.3
Notice: Undefined variable: mayches in /in/lCjMh on line 9 NULL string(4) "Heee" string(8) "Zend\Ha\"
Output for 4.3.0 - 4.3.2
Notice: Undefined variable: mayches in /in/lCjMh on line 9 NULL string(0) "" string(0) ""