3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $urlPath = parse_url('http://tvil.ru/city/gelendzhik/hotels/341229/', PHP_URL_PATH); $pathParts = explode('/', $urlPath); $pathParts = array_filter($old_array, function($element) { return !empty($element); }); var_dump($pathParts);
based on TPfLR
Output for 5.6.0 - 7.2.6
Notice: Undefined variable: old_array in /in/l2h88 on line 5 Warning: array_filter() expects parameter 1 to be array, null given in /in/l2h88 on line 7 NULL