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/november.jpg', '', ]; var_dump(array_udiff($files, $exclude, function($a, $b) { var_dump($a, $b, strpos($a, $b)); return strpos($a, $b) === false ? 1 : 0; }));
Output for 7.0.0 - 7.3.0rc3
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(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/plugins/myplugin.php" string(56) "/usr/share/nginx/wordpress/wp-content/themes/mytheme.php" bool(false) string(58) "/usr/share/nginx/wordpress/wp-content/plugins/myplugin.php" string(57) "/usr/share/nginx/wordpress/wp-content/plugins/akismet.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(54) "/usr/share/nginx/wordpress/wp-content/themes/index.php" string(57) "/usr/share/nginx/wordpress/wp-content/plugins/akismet.php" bool(false) string(58) "/usr/share/nginx/wordpress/wp-content/plugins/myplugin.php" string(58) "/usr/share/nginx/wordpress/wp-content/uploads/november.jpg" bool(false) string(56) "/usr/share/nginx/wordpress/wp-content/themes/mytheme.php" string(58) "/usr/share/nginx/wordpress/wp-content/uploads/november.jpg" bool(false) string(54) "/usr/share/nginx/wordpress/wp-content/themes/index.php" string(58) "/usr/share/nginx/wordpress/wp-content/uploads/november.jpg" 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(58) "/usr/share/nginx/wordpress/wp-content/uploads/november.jpg" bool(false) string(0) "" string(58) "/usr/share/nginx/wordpress/wp-content/uploads/november.jpg" bool(false) Warning: strpos(): Empty needle in /in/r3ERn on line 19 string(58) "/usr/share/nginx/wordpress/wp-content/plugins/myplugin.php" string(0) "" bool(false) Warning: strpos(): Empty needle in /in/r3ERn on line 20 string(58) "/usr/share/nginx/wordpress/wp-content/uploads/november.jpg" string(58) "/usr/share/nginx/wordpress/wp-content/uploads/november.jpg" 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) Warning: strpos(): Empty needle in /in/r3ERn on line 19 string(57) "/usr/share/nginx/wordpress/wp-content/plugins/akismet.php" string(0) "" bool(false) Warning: strpos(): Empty needle in /in/r3ERn on line 20 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(57) "/usr/share/nginx/wordpress/wp-content/plugins/akismet.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(58) "/usr/share/nginx/wordpress/wp-content/plugins/myplugin.php" bool(false) array(4) { [0]=> string(58) "/usr/share/nginx/wordpress/wp-content/plugins/myplugin.php" [1]=> string(54) "/usr/share/nginx/wordpress/wp-content/themes/index.php" [2]=> string(56) "/usr/share/nginx/wordpress/wp-content/themes/mytheme.php" [3]=> string(57) "/usr/share/nginx/wordpress/wp-content/plugins/akismet.php" }
Output for hhvm-3.22.0
string(58) "/usr/share/nginx/wordpress/wp-content/uploads/november.jpg" string(58) "/usr/share/nginx/wordpress/wp-content/plugins/myplugin.php" bool(false) string(0) "" 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(58) "/usr/share/nginx/wordpress/wp-content/uploads/november.jpg" bool(false) Warning: Empty delimiter in /in/r3ERn on line -1 string(58) "/usr/share/nginx/wordpress/wp-content/plugins/myplugin.php" string(0) "" bool(false) Warning: Empty delimiter in /in/r3ERn on line -1 string(54) "/usr/share/nginx/wordpress/wp-content/themes/index.php" string(58) "/usr/share/nginx/wordpress/wp-content/uploads/november.jpg" bool(false) Warning: Empty delimiter in /in/r3ERn on line -1 string(54) "/usr/share/nginx/wordpress/wp-content/themes/index.php" string(0) "" bool(false) Warning: Empty delimiter in /in/r3ERn on line -1 string(56) "/usr/share/nginx/wordpress/wp-content/themes/mytheme.php" string(58) "/usr/share/nginx/wordpress/wp-content/uploads/november.jpg" bool(false) Warning: Empty delimiter in /in/r3ERn on line -1 string(56) "/usr/share/nginx/wordpress/wp-content/themes/mytheme.php" string(0) "" bool(false) Warning: Empty delimiter in /in/r3ERn on line -1 string(57) "/usr/share/nginx/wordpress/wp-content/plugins/akismet.php" string(58) "/usr/share/nginx/wordpress/wp-content/uploads/november.jpg" bool(false) Warning: Empty delimiter in /in/r3ERn on line -1 string(57) "/usr/share/nginx/wordpress/wp-content/plugins/akismet.php" string(0) "" bool(false) Warning: Empty delimiter in /in/r3ERn on line -1 string(58) "/usr/share/nginx/wordpress/wp-content/uploads/november.jpg" string(58) "/usr/share/nginx/wordpress/wp-content/uploads/november.jpg" int(0) array(4) { [0]=> string(58) "/usr/share/nginx/wordpress/wp-content/plugins/myplugin.php" [1]=> string(54) "/usr/share/nginx/wordpress/wp-content/themes/index.php" [2]=> string(56) "/usr/share/nginx/wordpress/wp-content/themes/mytheme.php" [3]=> string(57) "/usr/share/nginx/wordpress/wp-content/plugins/akismet.php" }
Output for hhvm-3.15.4 - 3.21.3
string(58) "/usr/share/nginx/wordpress/wp-content/uploads/november.jpg" string(58) "/usr/share/nginx/wordpress/wp-content/plugins/myplugin.php" bool(false) string(0) "" 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(58) "/usr/share/nginx/wordpress/wp-content/uploads/november.jpg" bool(false) Warning: Empty delimiter in /in/r3ERn on line 19 string(58) "/usr/share/nginx/wordpress/wp-content/plugins/myplugin.php" string(0) "" bool(false) Warning: Empty delimiter in /in/r3ERn on line 20 string(54) "/usr/share/nginx/wordpress/wp-content/themes/index.php" string(58) "/usr/share/nginx/wordpress/wp-content/uploads/november.jpg" bool(false) Warning: Empty delimiter in /in/r3ERn on line 19 string(54) "/usr/share/nginx/wordpress/wp-content/themes/index.php" string(0) "" bool(false) Warning: Empty delimiter in /in/r3ERn on line 20 string(56) "/usr/share/nginx/wordpress/wp-content/themes/mytheme.php" string(58) "/usr/share/nginx/wordpress/wp-content/uploads/november.jpg" bool(false) Warning: Empty delimiter in /in/r3ERn on line 19 string(56) "/usr/share/nginx/wordpress/wp-content/themes/mytheme.php" string(0) "" bool(false) Warning: Empty delimiter in /in/r3ERn on line 20 string(57) "/usr/share/nginx/wordpress/wp-content/plugins/akismet.php" string(58) "/usr/share/nginx/wordpress/wp-content/uploads/november.jpg" bool(false) Warning: Empty delimiter in /in/r3ERn on line 19 string(57) "/usr/share/nginx/wordpress/wp-content/plugins/akismet.php" string(0) "" bool(false) Warning: Empty delimiter in /in/r3ERn on line 20 string(58) "/usr/share/nginx/wordpress/wp-content/uploads/november.jpg" string(58) "/usr/share/nginx/wordpress/wp-content/uploads/november.jpg" int(0) array(4) { [0]=> string(58) "/usr/share/nginx/wordpress/wp-content/plugins/myplugin.php" [1]=> string(54) "/usr/share/nginx/wordpress/wp-content/themes/index.php" [2]=> string(56) "/usr/share/nginx/wordpress/wp-content/themes/mytheme.php" [3]=> string(57) "/usr/share/nginx/wordpress/wp-content/plugins/akismet.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(56) "/usr/share/nginx/wordpress/wp-content/themes/mytheme.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(57) "/usr/share/nginx/wordpress/wp-content/plugins/akismet.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(54) "/usr/share/nginx/wordpress/wp-content/themes/index.php" string(57) "/usr/share/nginx/wordpress/wp-content/plugins/akismet.php" 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(58) "/usr/share/nginx/wordpress/wp-content/uploads/november.jpg" string(58) "/usr/share/nginx/wordpress/wp-content/plugins/myplugin.php" bool(false) string(0) "" string(58) "/usr/share/nginx/wordpress/wp-content/uploads/november.jpg" 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(57) "/usr/share/nginx/wordpress/wp-content/plugins/akismet.php" string(58) "/usr/share/nginx/wordpress/wp-content/uploads/november.jpg" bool(false) Warning: strpos(): Empty needle in /in/r3ERn on line 19 string(57) "/usr/share/nginx/wordpress/wp-content/plugins/akismet.php" string(0) "" bool(false) Warning: strpos(): Empty needle in /in/r3ERn on line 20 string(57) "/usr/share/nginx/wordpress/wp-content/plugins/akismet.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) string(58) "/usr/share/nginx/wordpress/wp-content/plugins/myplugin.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(58) "/usr/share/nginx/wordpress/wp-content/uploads/november.jpg" bool(false) array(5) { [0]=> string(58) "/usr/share/nginx/wordpress/wp-content/plugins/myplugin.php" [1]=> string(54) "/usr/share/nginx/wordpress/wp-content/themes/index.php" [2]=> 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" }