3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function getClassName($namespaceClass) { $lastSlashPosition = mb_strrpos($namespaceClass, '\\'); if ($lastSlashPosition !== false) { return mb_substr($namespaceClass, $lastSlashPosition + 1); } return $namespaceClass; } function getNamespace($namespaceClass) { if (is_object($namespaceClass)) { $namespaceClass = get_class($namespaceClass); } $lastSlashPosition = mb_strrpos($namespaceClass, '\\'); if ($lastSlashPosition !== false) { return mb_substr($namespaceClass, 0, $lastSlashPosition); } return ""; }
Output for 4.3.0 - 7.2.0