3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr1 = [ ["name"=>"col11", "type"=>"varchar"], ["name"=>"col2", "type"=>"int"] ]; $arr2 = [ ["name"=>"col1", "type"=>"varchar"], ["name"=>"col2", "type"=>"int"] , ["name"=>"col3", "type"=>"date"] ]; $arr3 = [ ["name"=>"col1", "type"=>"varchar"], ["name"=>"col3", "type"=>"int"] ]; $arrays = [$arr1, $arr2, $arr3]; $arrays_extended = []; foreach($arrays as $row => $innerArray){ foreach($innerArray as $innerRow => $value){ array_push($arrays_extended, $value); } } var_dump(array_unique($arrays_extended));
Output for 8.0.0 - 8.0.30, 8.1.0 - 8.1.33, 8.2.0 - 8.2.29, 8.3.0 - 8.3.28, 8.4.1 - 8.4.14, 8.4.16, 8.5.0 - 8.5.1
Warning: Array to string conversion in /in/1okcm on line 24 Warning: Array to string conversion in /in/1okcm on line 24 Warning: Array to string conversion in /in/1okcm on line 24 Warning: Array to string conversion in /in/1okcm on line 24 Warning: Array to string conversion in /in/1okcm on line 24 Warning: Array to string conversion in /in/1okcm on line 24 Warning: Array to string conversion in /in/1okcm on line 24 array(1) { [0]=> array(2) { ["name"]=> string(5) "col11" ["type"]=> string(7) "varchar" } }
Output for 8.4.15
/bin/php-8.4.15: /usr/lib/libm.so.6: version `GLIBC_2.38' not found (required by /bin/php-8.4.15) /bin/php-8.4.15: /usr/lib/libm.so.6: version `GLIBC_2.35' not found (required by /bin/php-8.4.15) /bin/php-8.4.15: /usr/lib/libc.so.6: version `GLIBC_2.34' not found (required by /bin/php-8.4.15) /bin/php-8.4.15: /usr/lib/libc.so.6: version `GLIBC_2.38' not found (required by /bin/php-8.4.15)
Process exited with code 1.
Output for 7.2.0 - 7.2.33, 7.3.16 - 7.3.31, 7.4.0 - 7.4.33
Notice: Array to string conversion in /in/1okcm on line 24 Notice: Array to string conversion in /in/1okcm on line 24 Notice: Array to string conversion in /in/1okcm on line 24 Notice: Array to string conversion in /in/1okcm on line 24 Notice: Array to string conversion in /in/1okcm on line 24 Notice: Array to string conversion in /in/1okcm on line 24 Notice: Array to string conversion in /in/1okcm on line 24 array(1) { [0]=> array(2) { ["name"]=> string(5) "col11" ["type"]=> string(7) "varchar" } }
Output for 7.3.32 - 7.3.33
array(1) { [0]=> array(2) { ["name"]=> string(5) "col11" ["type"]=> string(7) "varchar" } }
Output for 7.1.0 - 7.1.20
Notice: Array to string conversion in /in/1okcm on line 24 Notice: Array to string conversion in /in/1okcm on line 24 Notice: Array to string conversion in /in/1okcm on line 24 Notice: Array to string conversion in /in/1okcm on line 24 Notice: Array to string conversion in /in/1okcm on line 24 Notice: Array to string conversion in /in/1okcm on line 24 Notice: Array to string conversion in /in/1okcm on line 24 Notice: Array to string conversion in /in/1okcm on line 24 Notice: Array to string conversion in /in/1okcm on line 24 Notice: Array to string conversion in /in/1okcm on line 24 Notice: Array to string conversion in /in/1okcm on line 24 Notice: Array to string conversion in /in/1okcm on line 24 Notice: Array to string conversion in /in/1okcm on line 24 Notice: Array to string conversion in /in/1okcm on line 24 Notice: Array to string conversion in /in/1okcm on line 24 Notice: Array to string conversion in /in/1okcm on line 24 Notice: Array to string conversion in /in/1okcm on line 24 Notice: Array to string conversion in /in/1okcm on line 24 Notice: Array to string conversion in /in/1okcm on line 24 Notice: Array to string conversion in /in/1okcm on line 24 Notice: Array to string conversion in /in/1okcm on line 24 Notice: Array to string conversion in /in/1okcm on line 24 Notice: Array to string conversion in /in/1okcm on line 24 Notice: Array to string conversion in /in/1okcm on line 24 array(1) { [0]=> array(2) { ["name"]=> string(5) "col11" ["type"]=> string(7) "varchar" } }

preferences:
174.33 ms | 417 KiB | 5 Q