3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $files = [ '/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/myplugin.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/uploads', '/usr/share/nginx/wordpress/wp-content/plugins/myplugin.php', ]; var_dump(array_udiff($files, $exclude, function($a, $b) { var_dump($a, $b, "--"); return strpos($a, $b) === false ? 1 : 0; }));
Output for 7.0.0 - 7.3.0rc3
string(54) "/usr/share/nginx/wordpress/wp-content/themes/index.php" string(56) "/usr/share/nginx/wordpress/wp-content/themes/mytheme.php" string(2) "--" string(58) "/usr/share/nginx/wordpress/wp-content/plugins/myplugin.php" string(56) "/usr/share/nginx/wordpress/wp-content/themes/mytheme.php" string(2) "--" string(54) "/usr/share/nginx/wordpress/wp-content/themes/index.php" string(58) "/usr/share/nginx/wordpress/wp-content/plugins/myplugin.php" string(2) "--" string(54) "/usr/share/nginx/wordpress/wp-content/themes/index.php" string(57) "/usr/share/nginx/wordpress/wp-content/plugins/akismet.php" string(2) "--" string(58) "/usr/share/nginx/wordpress/wp-content/plugins/myplugin.php" string(57) "/usr/share/nginx/wordpress/wp-content/plugins/akismet.php" string(2) "--" string(56) "/usr/share/nginx/wordpress/wp-content/themes/mytheme.php" string(57) "/usr/share/nginx/wordpress/wp-content/plugins/akismet.php" string(2) "--" string(54) "/usr/share/nginx/wordpress/wp-content/themes/index.php" string(58) "/usr/share/nginx/wordpress/wp-content/uploads/november.jpg" string(2) "--" string(58) "/usr/share/nginx/wordpress/wp-content/plugins/myplugin.php" string(58) "/usr/share/nginx/wordpress/wp-content/uploads/november.jpg" string(2) "--" string(56) "/usr/share/nginx/wordpress/wp-content/themes/mytheme.php" string(58) "/usr/share/nginx/wordpress/wp-content/uploads/november.jpg" string(2) "--" string(57) "/usr/share/nginx/wordpress/wp-content/plugins/akismet.php" string(58) "/usr/share/nginx/wordpress/wp-content/uploads/november.jpg" string(2) "--" string(45) "/usr/share/nginx/wordpress/wp-content/uploads" string(58) "/usr/share/nginx/wordpress/wp-content/plugins/myplugin.php" string(2) "--" string(58) "/usr/share/nginx/wordpress/wp-content/uploads/november.jpg" string(58) "/usr/share/nginx/wordpress/wp-content/plugins/myplugin.php" string(2) "--" string(58) "/usr/share/nginx/wordpress/wp-content/uploads/november.jpg" string(45) "/usr/share/nginx/wordpress/wp-content/uploads" string(2) "--" string(58) "/usr/share/nginx/wordpress/wp-content/uploads/november.jpg" string(57) "/usr/share/nginx/wordpress/wp-content/plugins/akismet.php" string(2) "--" string(57) "/usr/share/nginx/wordpress/wp-content/plugins/akismet.php" string(56) "/usr/share/nginx/wordpress/wp-content/themes/mytheme.php" string(2) "--" string(56) "/usr/share/nginx/wordpress/wp-content/themes/mytheme.php" string(58) "/usr/share/nginx/wordpress/wp-content/plugins/myplugin.php" string(2) "--" string(58) "/usr/share/nginx/wordpress/wp-content/plugins/myplugin.php" string(54) "/usr/share/nginx/wordpress/wp-content/themes/index.php" string(2) "--" array(4) { [0]=> string(54) "/usr/share/nginx/wordpress/wp-content/themes/index.php" [1]=> string(56) "/usr/share/nginx/wordpress/wp-content/themes/mytheme.php" [2]=> string(58) "/usr/share/nginx/wordpress/wp-content/plugins/myplugin.php" [3]=> string(57) "/usr/share/nginx/wordpress/wp-content/plugins/akismet.php" }
Output for hhvm-3.15.4
string(58) "/usr/share/nginx/wordpress/wp-content/plugins/myplugin.php" string(45) "/usr/share/nginx/wordpress/wp-content/uploads" string(2) "--" string(54) "/usr/share/nginx/wordpress/wp-content/themes/index.php" string(58) "/usr/share/nginx/wordpress/wp-content/plugins/myplugin.php" string(2) "--" string(56) "/usr/share/nginx/wordpress/wp-content/themes/mytheme.php" string(58) "/usr/share/nginx/wordpress/wp-content/plugins/myplugin.php" string(2) "--" string(58) "/usr/share/nginx/wordpress/wp-content/plugins/myplugin.php" string(58) "/usr/share/nginx/wordpress/wp-content/plugins/myplugin.php" string(2) "--" string(57) "/usr/share/nginx/wordpress/wp-content/plugins/akismet.php" string(58) "/usr/share/nginx/wordpress/wp-content/plugins/myplugin.php" string(2) "--" string(58) "/usr/share/nginx/wordpress/wp-content/uploads/november.jpg" string(58) "/usr/share/nginx/wordpress/wp-content/plugins/myplugin.php" string(2) "--" array(4) { [0]=> string(54) "/usr/share/nginx/wordpress/wp-content/themes/index.php" [1]=> string(56) "/usr/share/nginx/wordpress/wp-content/themes/mytheme.php" [3]=> string(57) "/usr/share/nginx/wordpress/wp-content/plugins/akismet.php" [4]=> string(58) "/usr/share/nginx/wordpress/wp-content/uploads/november.jpg" }
Output for 5.6.0 - 5.6.30
string(58) "/usr/share/nginx/wordpress/wp-content/plugins/myplugin.php" string(56) "/usr/share/nginx/wordpress/wp-content/themes/mytheme.php" string(2) "--" string(58) "/usr/share/nginx/wordpress/wp-content/plugins/myplugin.php" string(54) "/usr/share/nginx/wordpress/wp-content/themes/index.php" string(2) "--" string(58) "/usr/share/nginx/wordpress/wp-content/plugins/myplugin.php" string(57) "/usr/share/nginx/wordpress/wp-content/plugins/akismet.php" string(2) "--" string(58) "/usr/share/nginx/wordpress/wp-content/uploads/november.jpg" string(58) "/usr/share/nginx/wordpress/wp-content/plugins/myplugin.php" string(2) "--" string(56) "/usr/share/nginx/wordpress/wp-content/themes/mytheme.php" string(57) "/usr/share/nginx/wordpress/wp-content/plugins/akismet.php" string(2) "--" string(54) "/usr/share/nginx/wordpress/wp-content/themes/index.php" string(56) "/usr/share/nginx/wordpress/wp-content/themes/mytheme.php" string(2) "--" string(58) "/usr/share/nginx/wordpress/wp-content/plugins/myplugin.php" string(45) "/usr/share/nginx/wordpress/wp-content/uploads" string(2) "--" string(57) "/usr/share/nginx/wordpress/wp-content/plugins/akismet.php" string(45) "/usr/share/nginx/wordpress/wp-content/uploads" string(2) "--" string(57) "/usr/share/nginx/wordpress/wp-content/plugins/akismet.php" string(58) "/usr/share/nginx/wordpress/wp-content/plugins/myplugin.php" string(2) "--" string(57) "/usr/share/nginx/wordpress/wp-content/plugins/akismet.php" string(56) "/usr/share/nginx/wordpress/wp-content/themes/mytheme.php" string(2) "--" string(56) "/usr/share/nginx/wordpress/wp-content/themes/mytheme.php" string(54) "/usr/share/nginx/wordpress/wp-content/themes/index.php" string(2) "--" string(54) "/usr/share/nginx/wordpress/wp-content/themes/index.php" string(58) "/usr/share/nginx/wordpress/wp-content/plugins/myplugin.php" string(2) "--" string(58) "/usr/share/nginx/wordpress/wp-content/plugins/myplugin.php" string(58) "/usr/share/nginx/wordpress/wp-content/uploads/november.jpg" string(2) "--" array(5) { [0]=> string(54) "/usr/share/nginx/wordpress/wp-content/themes/index.php" [1]=> string(56) "/usr/share/nginx/wordpress/wp-content/themes/mytheme.php" [2]=> string(58) "/usr/share/nginx/wordpress/wp-content/plugins/myplugin.php" [3]=> string(57) "/usr/share/nginx/wordpress/wp-content/plugins/akismet.php" [4]=> string(58) "/usr/share/nginx/wordpress/wp-content/uploads/november.jpg" }