3v4l.org

run code in 300+ PHP versions simultaneously
<?php var_export([ // haystack, then needle 'a:aa' => str_contains('a', 'aa'), // false ...cast to 0 'aa:a' => str_contains('aa', 'a'), // true ...cast to 1 'a:a' => str_contains('a', 'a'), // true ...cast to 1 'aa:aa' => str_contains('aa', 'aa'), // true ...cast to 1 ]); echo "\n---\n"; $params = [ ['one' => 'a', 'two' => 'aa', 'three' => 'a', 'four' => 'aa'], // haystacks ['three' => 'a', 'one' => 'aa', 'four' => 'aa', 'two' => 'a'], // needles 'str_contains' ]; var_export([ 'udiff' => array_udiff_assoc(...$params), 'uintersect' => array_uintersect_assoc(...$params), ]);
Output for git.master, git.master_jit, rfc.property-hooks
array ( 'a:aa' => false, 'aa:a' => true, 'a:a' => true, 'aa:aa' => true, ) --- array ( 'udiff' => array ( 'two' => 'aa', 'three' => 'a', 'four' => 'aa', ), 'uintersect' => array ( 'one' => 'a', ), )

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