3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $files = [ '/usr/share/nginx/wordpress/wp-content/plugins/myplugin.php', '/usr/share/nginx/wordpress/wp-content/themes/index.php', '/usr/share/nginx/wordpress/wp-content/themes/mytheme.php', '/usr/share/nginx/wordpress/wp-content/plugins/akismet.php', '/usr/share/nginx/wordpress/wp-content/uploads/november.jpg', ]; $exclude = [ '/usr/share/nginx/wordpress/wp-content/plugins/myplugin.php', '/usr/share/nginx/wordpress/wp-content/uploads', ]; // tamamen eşit klasör ya da dosya = 0 // klasörden dolayı alt dosya olabilir = 1 // hiç eşleşmeyebilir = -1 var_dump(array_udiff($files, $exclude, function($a, $b) { var_dump($a, $b, strpos($a, $b)); return strpos($a, $b) === false ? 0 : (strtolower($a) == strtolower($b) ? 1 : 0); }));
Output for 7.0.0 - 7.3.0beta2
string(58) "/usr/share/nginx/wordpress/wp-content/plugins/myplugin.php" string(54) "/usr/share/nginx/wordpress/wp-content/themes/index.php" bool(false) string(54) "/usr/share/nginx/wordpress/wp-content/themes/index.php" string(56) "/usr/share/nginx/wordpress/wp-content/themes/mytheme.php" bool(false) string(56) "/usr/share/nginx/wordpress/wp-content/themes/mytheme.php" string(57) "/usr/share/nginx/wordpress/wp-content/plugins/akismet.php" bool(false) string(57) "/usr/share/nginx/wordpress/wp-content/plugins/akismet.php" string(58) "/usr/share/nginx/wordpress/wp-content/uploads/november.jpg" bool(false) string(58) "/usr/share/nginx/wordpress/wp-content/plugins/myplugin.php" string(45) "/usr/share/nginx/wordpress/wp-content/uploads" bool(false) string(58) "/usr/share/nginx/wordpress/wp-content/plugins/myplugin.php" string(58) "/usr/share/nginx/wordpress/wp-content/plugins/myplugin.php" int(0) string(58) "/usr/share/nginx/wordpress/wp-content/plugins/myplugin.php" string(45) "/usr/share/nginx/wordpress/wp-content/uploads" bool(false) string(58) "/usr/share/nginx/wordpress/wp-content/plugins/myplugin.php" string(54) "/usr/share/nginx/wordpress/wp-content/themes/index.php" bool(false) string(54) "/usr/share/nginx/wordpress/wp-content/themes/index.php" string(56) "/usr/share/nginx/wordpress/wp-content/themes/mytheme.php" bool(false) string(56) "/usr/share/nginx/wordpress/wp-content/themes/mytheme.php" string(57) "/usr/share/nginx/wordpress/wp-content/plugins/akismet.php" bool(false) string(57) "/usr/share/nginx/wordpress/wp-content/plugins/akismet.php" string(58) "/usr/share/nginx/wordpress/wp-content/uploads/november.jpg" bool(false) array(0) { }
Output for hhvm-3.15.4 - 3.22.0
string(45) "/usr/share/nginx/wordpress/wp-content/uploads" string(58) "/usr/share/nginx/wordpress/wp-content/plugins/myplugin.php" bool(false) string(58) "/usr/share/nginx/wordpress/wp-content/plugins/myplugin.php" string(58) "/usr/share/nginx/wordpress/wp-content/plugins/myplugin.php" int(0) string(54) "/usr/share/nginx/wordpress/wp-content/themes/index.php" string(58) "/usr/share/nginx/wordpress/wp-content/plugins/myplugin.php" bool(false) string(56) "/usr/share/nginx/wordpress/wp-content/themes/mytheme.php" string(58) "/usr/share/nginx/wordpress/wp-content/plugins/myplugin.php" bool(false) string(57) "/usr/share/nginx/wordpress/wp-content/plugins/akismet.php" string(58) "/usr/share/nginx/wordpress/wp-content/plugins/myplugin.php" bool(false) string(58) "/usr/share/nginx/wordpress/wp-content/uploads/november.jpg" string(58) "/usr/share/nginx/wordpress/wp-content/plugins/myplugin.php" bool(false) array(1) { [0]=> string(58) "/usr/share/nginx/wordpress/wp-content/plugins/myplugin.php" }
Output for 5.6.30
string(56) "/usr/share/nginx/wordpress/wp-content/themes/mytheme.php" string(54) "/usr/share/nginx/wordpress/wp-content/themes/index.php" bool(false) string(58) "/usr/share/nginx/wordpress/wp-content/uploads/november.jpg" string(56) "/usr/share/nginx/wordpress/wp-content/themes/mytheme.php" bool(false) string(56) "/usr/share/nginx/wordpress/wp-content/themes/mytheme.php" string(58) "/usr/share/nginx/wordpress/wp-content/plugins/myplugin.php" bool(false) string(57) "/usr/share/nginx/wordpress/wp-content/plugins/akismet.php" string(56) "/usr/share/nginx/wordpress/wp-content/themes/mytheme.php" bool(false) string(58) "/usr/share/nginx/wordpress/wp-content/uploads/november.jpg" string(57) "/usr/share/nginx/wordpress/wp-content/plugins/akismet.php" bool(false) string(54) "/usr/share/nginx/wordpress/wp-content/themes/index.php" string(58) "/usr/share/nginx/wordpress/wp-content/plugins/myplugin.php" bool(false) string(45) "/usr/share/nginx/wordpress/wp-content/uploads" string(58) "/usr/share/nginx/wordpress/wp-content/plugins/myplugin.php" bool(false) string(58) "/usr/share/nginx/wordpress/wp-content/uploads/november.jpg" string(45) "/usr/share/nginx/wordpress/wp-content/uploads" int(0) string(58) "/usr/share/nginx/wordpress/wp-content/uploads/november.jpg" string(57) "/usr/share/nginx/wordpress/wp-content/plugins/akismet.php" bool(false) string(57) "/usr/share/nginx/wordpress/wp-content/plugins/akismet.php" string(56) "/usr/share/nginx/wordpress/wp-content/themes/mytheme.php" bool(false) string(56) "/usr/share/nginx/wordpress/wp-content/themes/mytheme.php" string(54) "/usr/share/nginx/wordpress/wp-content/themes/index.php" bool(false) string(54) "/usr/share/nginx/wordpress/wp-content/themes/index.php" string(58) "/usr/share/nginx/wordpress/wp-content/plugins/myplugin.php" bool(false) array(0) { }