3v4l.org

run code in 300+ PHP versions simultaneously
<?php $cakedata = [ ["shape" => "Heart", "flavor" => "Chocolate", "toppings" => "Cookies"], ["shape" => "Rectangle", "flavor" => "Vanilla", "toppings" => "Spun-sugar Flowers"], ["shape" => "Square", "flavor" => "Lemon", "toppings" => "Mini Chocolate Candies"], ["shape" => "Round", "flavor" => "Cheesecake", "toppings" => "Marshmallows"] ]; $td = <<<'TD' <td><label><input type="radio" name="%1$s" value="%2$s" required>%2$s</label></td> TD; foreach ($cakedata as $row) { echo '<tr>'; foreach ($row as $attr => $value) { printf($td, htmlentities($attr), htmlentities($value)); } echo '</tr>'; }
Output for 8.0.1 - 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 - 8.5.1
<tr> <td><label><input type="radio" name="shape" value="Heart" required>Heart</label></td> <td><label><input type="radio" name="flavor" value="Chocolate" required>Chocolate</label></td> <td><label><input type="radio" name="toppings" value="Cookies" required>Cookies</label></td></tr><tr> <td><label><input type="radio" name="shape" value="Rectangle" required>Rectangle</label></td> <td><label><input type="radio" name="flavor" value="Vanilla" required>Vanilla</label></td> <td><label><input type="radio" name="toppings" value="Spun-sugar Flowers" required>Spun-sugar Flowers</label></td></tr><tr> <td><label><input type="radio" name="shape" value="Square" required>Square</label></td> <td><label><input type="radio" name="flavor" value="Lemon" required>Lemon</label></td> <td><label><input type="radio" name="toppings" value="Mini Chocolate Candies" required>Mini Chocolate Candies</label></td></tr><tr> <td><label><input type="radio" name="shape" value="Round" required>Round</label></td> <td><label><input type="radio" name="flavor" value="Cheesecake" required>Cheesecake</label></td> <td><label><input type="radio" name="toppings" value="Marshmallows" required>Marshmallows</label></td></tr>
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:
140.62 ms | 408 KiB | 5 Q