3v4l.org

run code in 300+ PHP versions simultaneously
<?php $data = [ 'blue' => 43, 'red' => 87, 'purple' => 130, 'green' => 12, 'yellow' => 31 ]; $bad_keys1 = [ 'purple', 'yellow', ]; $bad_keys2 = [ 'green', ]; function remove_blacklisted_keys(array $haystack, array ...$blacklists) { return array_diff_key($haystack, array_flip(array_merge(...$blacklists))); } function remove_blacklisted_keys_preflipped(array $haystack, array ...$blacklists) { return array_diff_key($haystack, ...$blacklists); } var_export(remove_blacklisted_keys($data, $bad_keys1)); echo "\n"; var_export(remove_blacklisted_keys($data, $bad_keys1, $bad_keys2)); echo "\n"; var_export(remove_blacklisted_keys_preflipped($data, array_flip($bad_keys1))); echo "\n"; var_export(remove_blacklisted_keys_preflipped($data, array_flip($bad_keys1), array_flip($bad_keys2)));
Output for rfc.property-hooks
array ( 'blue' => 43, 'red' => 87, 'green' => 12, ) array ( 'blue' => 43, 'red' => 87, ) array ( 'blue' => 43, 'red' => 87, 'green' => 12, ) array ( 'blue' => 43, 'red' => 87, )
Output for git.master, git.master_jit
/bin/php-git-master: error while loading shared libraries: libonig.so.5: cannot open shared object file: No such file or directory
Process exited with code 127.

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
26.64 ms | 1137 KiB | 4 Q