3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array1 = ["a" => "green", "b" => "brown", "c" => "blue", 0 => "red"]; $array2 = ["a" => "GREEN", "B" => "brown", 0 => "yellow", 1 => "red", "c" => "blue"]; var_export( array_uintersect_assoc( $array1, $array2, function ($a, $b) { //var_export([$a, $b, str_contains($a, $b), (bool)str_contains($a, $b), (int)(bool)str_contains($a, $b)]); //echo "\n"; return str_contains($a, $b); } ) ); echo "\n---\n"; var_export( array_udiff_assoc( $array1, $array2, function ($a, $b) { //var_export([$a, $b, str_contains($a, $b), (bool)str_contains($a, $b), (int)(bool)str_contains($a, $b)]); //echo "\n"; return str_contains($a, $b); } ) ); echo "\n---\n"; var_export( array_uintersect_assoc( $array1, $array2, function ($a, $b) { return str_contains($a, $b) ? 0 : 1; } ) );
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.
Output for rfc.property-hooks
array ( 'a' => 'green', 0 => 'red', ) --- array ( 'b' => 'brown', 'c' => 'blue', ) --- array ( 'c' => 'blue', )

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:
82.66 ms | 406 KiB | 5 Q