3v4l.org

run code in 150+ 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 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0