3v4l.org

run code in 300+ PHP versions simultaneously
<?php $product = array('a','b','c','d'); echo '<table border="1">'; echo "<tr><th>Product 1</th><th>Product 2</th><th>Similarity</th></tr>\n"; Foreach($product as $key => $a){ Foreach(array_slice($product, $key+1) as $b){ echo '<tr><td>'.$a.'</td><td>'.$b."</td></tr>\n"; } } echo '</table>';
Output for 5.6.20, 7.1.0 - 7.1.21, 7.2.0 - 7.2.33, 7.3.16 - 7.3.33, 7.4.0 - 7.4.33, 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.5.0
<table border="1"><tr><th>Product 1</th><th>Product 2</th><th>Similarity</th></tr> <tr><td>a</td><td>b</td></tr> <tr><td>a</td><td>c</td></tr> <tr><td>a</td><td>d</td></tr> <tr><td>b</td><td>c</td></tr> <tr><td>b</td><td>d</td></tr> <tr><td>c</td><td>d</td></tr> </table>
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.

preferences:
176.73 ms | 407 KiB | 5 Q