3v4l.org

run code in 300+ PHP versions simultaneously
<?php ?> <form name="tempConvert" method="POST" action="<?php echo $_SERVER["PHP_SELF"]; ?>"> <table> <tr> <td>Enter value to convert</td> <td><input type="text" name="valueConvert" id="valueConvert" size="15"></td> </tr> <tr> <td>Convert to:</td> <td><select name="convertType" id="convertType" size="1"> <option disabled> Select a measurement type</option> <option value="celsius">Celsius</option> <option value="fahrenheit">Fahrenheit</option> </select> </td> </tr> <tr> <td><input type="submit" name="btnConvert" id="btnConvert" value="Convert"></td> <td><input type="reset" name="btnReset" id="btnReset" value="Reset"></td> </tr> </form> <?php function tempConvert($value, $type){ if($type== "fahrenheit"){ return (((9/5)*$value) +(32)); } elseif ($type== "celsius"){ return (($valueConvert - 32) * (9/5)); } } if (isset($_POST['btnConvert'])) { $valueConvert = $_POST['valueConvert']; $convertType = $_POST['convertType']; echo "The initial temperature was $valueConvert. The new temperature is tempConvert($valueConvert, $convertType)."; } ?>
Output for git.master, git.master_jit, rfc.property-hooks
<form name="tempConvert" method="POST" action="/in/PPZNL"> <table> <tr> <td>Enter value to convert</td> <td><input type="text" name="valueConvert" id="valueConvert" size="15"></td> </tr> <tr> <td>Convert to:</td> <td><select name="convertType" id="convertType" size="1"> <option disabled> Select a measurement type</option> <option value="celsius">Celsius</option> <option value="fahrenheit">Fahrenheit</option> </select> </td> </tr> <tr> <td><input type="submit" name="btnConvert" id="btnConvert" value="Convert"></td> <td><input type="reset" name="btnReset" id="btnReset" value="Reset"></td> </tr> </form>

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:
32.32 ms | 403 KiB | 8 Q