3v4l.org

run code in 300+ PHP versions simultaneously
<!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title></title> <script src="jquery-2.1.1.min.js"></script> <script> $(document).ready(function(){ $("#btnKomentiraj").click(function(){ var selectElement = document.getElementById('selectElement'), textField = document.getElementById('txtField'), textValue = textField.value, selectedValue = selectElement.value; // ne koristi se html mada bi se moglo kako se asdrzaj nebi nadopunjavao $("#divKomentari").append("<p>Komentar: " + textValue + "</p><p>Ocjena komentara: " + selectedValue + "</p>"); }); $("#btnClear").click(function(){ $("#divKomentari").empty(); }); }); </script> </head> <body> <?php $ocjene =array('lose','super','dobro'); echo 'Komentar: '; echo '<input type="text" id="txtField" style="width:200px;">'; echo '<select id="selectElement" style="margin-left:10px;">'; foreach($ocjene as $opis){ echo "<option value='{$opis}'>{$opis}</option>"; } echo '</select>'; echo '<button id="btnKomentiraj" style="margin-left:10px;">Komentiraj</button>'; ?> <div id="divKomentari"></div> </body> </html>
Output for git.master, git.master_jit, rfc.property-hooks
<!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title></title> <script src="jquery-2.1.1.min.js"></script> <script> $(document).ready(function(){ $("#btnKomentiraj").click(function(){ var selectElement = document.getElementById('selectElement'), textField = document.getElementById('txtField'), textValue = textField.value, selectedValue = selectElement.value; // ne koristi se html mada bi se moglo kako se asdrzaj nebi nadopunjavao $("#divKomentari").append("<p>Komentar: " + textValue + "</p><p>Ocjena komentara: " + selectedValue + "</p>"); }); $("#btnClear").click(function(){ $("#divKomentari").empty(); }); }); </script> </head> <body> Komentar: <input type="text" id="txtField" style="width:200px;"><select id="selectElement" style="margin-left:10px;"><option value='lose'>lose</option><option value='super'>super</option><option value='dobro'>dobro</option></select><button id="btnKomentiraj" style="margin-left:10px;">Komentiraj</button> <div id="divKomentari"></div> </body> </html>

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:
61.73 ms | 404 KiB | 8 Q