3v4l.org

run code in 300+ PHP versions simultaneously
<?php $sections = [ [ 'sectionwidth' => 525, 'sectionheight' => 500, 'bg' => 'eaeaea', 'sectioncolor' => 'c0c0c0', 'input' => [ [ 'inputtext' => 'test', 'inputwidth' => 505 ], [ 'inputtext' => 'test2', 'inputwidth' => 505 ] ] ], [ 'sectionwidth' => 525, 'sectionheight' => 500, 'bg' => '222222', 'sectioncolor' => 'ffffff', 'input' => [ [ 'inputtext' => 'test3', 'inputwidth' => 505 ], [ 'inputtext' => 'test4', 'inputwidth' => 505 ] ] ], ]; foreach ($sections as $section) { echo '<div style="width: '.$section['sectionwidth'].'px; height: '.$section['sectionheight'].'px; background: #'.$section['bg'].'; color: '.$section['sectioncolor'].'">'; foreach ($section['input'] as $input) { echo '<p style="width: '.$input['inputwidth'].'px;">'.$input['inputtext'].'</p>'; } echo '</div>'; }
Output for 5.6.0 - 5.6.40, 7.0.0 - 7.0.33, 7.1.0 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.4, 8.3.6
<div style="width: 525px; height: 500px; background: #eaeaea; color: c0c0c0"><p style="width: 505px;">test</p><p style="width: 505px;">test2</p></div><div style="width: 525px; height: 500px; background: #222222; color: ffffff"><p style="width: 505px;">test3</p><p style="width: 505px;">test4</p></div>
Output for 8.3.5
Warning: PHP Startup: Unable to load dynamic library 'sodium.so' (tried: /usr/lib/php/8.3.5/modules/sodium.so (libsodium.so.23: cannot open shared object file: No such file or directory), /usr/lib/php/8.3.5/modules/sodium.so.so (/usr/lib/php/8.3.5/modules/sodium.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0 <div style="width: 525px; height: 500px; background: #eaeaea; color: c0c0c0"><p style="width: 505px;">test</p><p style="width: 505px;">test2</p></div><div style="width: 525px; height: 500px; background: #222222; color: ffffff"><p style="width: 505px;">test3</p><p style="width: 505px;">test4</p></div>

preferences:
220.05 ms | 402 KiB | 291 Q