3v4l.org

run code in 300+ PHP versions simultaneously
<?php function array_equal_set() { return count(array_unique(array_map(function ($arr) { return serialize(array_values(array_unique($arr))); }, func_get_args()))) === 1; } $test_cases = array( /* 0 */ array( 'A' , 'B' , 'C' ), /* 1 */ array( 'A' , 'C' , 'B' ), /* 2 */ array( 'B' , 'A' , 'C' ), /* 3 */ array( 'B' , 'C' , 'A' ), /* 4 */ array( 'C' , 'A' , 'B' ), /* 5 */ array( 'C' , 'B' , 'A' ), /* 6 */ array( 'A' , 'B' , 'C' , 'D' ), /* 7 */ array( 'A' , 'B' , 'D' ), /* 8 */ array( 'A' , 'B' , 'B' ), /* 9 */ array( 'A' , 'B' ), /* 10 */ array( 'A' , 'B' , 'C' , 'B' ), ); // test $data = array( 'A' , 'B' , 'C' ); foreach( $test_cases as $key => $test ){ $result = array_equal_set( $test, $data ) ? 'TRUE' : 'FALSE' ; echo "[$key]$result" . PHP_EOL; }
Output for git.master, git.master_jit, rfc.property-hooks
[0]TRUE [1]FALSE [2]FALSE [3]FALSE [4]FALSE [5]FALSE [6]FALSE [7]FALSE [8]FALSE [9]FALSE [10]TRUE

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:
41.27 ms | 401 KiB | 8 Q