3v4l.org

run code in 300+ PHP versions simultaneously
<?php /** * Created by PhpStorm. * User: efik * Date: 20.09.16 * Time: 13:40 */ ///////////////////////// TEST ////////////////// $_POST = [ 'napoj' => 'herbata', 'name' => 'Krzysi', 'second_name' => 'dd' ]; $_SERVER["REQUEST_METHOD"] = 'POST'; /////////////////////// KONIEC DANYCH TESTOWYCH ///////// if($_SERVER["REQUEST_METHOD"] !== "POST") { exit; } if(!(['faktura', 'napoj', 'name', 'second_name'] === array_keys($_POST))){ echo "Wszystkie pola muszą być wypełnione! <br>"; exit; } $faktura = $_POST['faktura'] == 'on' ? 'Tak' : 'Nie'; $napoj = $_POST['napoj']; $name = $_POST['name']; $secondName = $_POST['second_name']; $orderDate = (new DateTime())->format("H:i, Y-m-d"); echo "Imie: {$name} <br>"; echo "Nazwisko: {$secondName} <br>"; echo "Faktura: {$faktura}<br>"; echo "Zamówienie: "; switch($napoj) { case 'herbata': echo "herabata"; break; case 'kawa': echo "herabata"; break; case 'pepsi': echo "herabata"; break; case 'woda mineralna': echo "woda mineralna"; break; } echo "<br>"; echo "Zamówienie złożone: {$orderDate} ";
Output for git.master, git.master_jit, rfc.property-hooks
Wszystkie pola muszą być wypełnione! <br>

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:
27.95 ms | 405 KiB | 5 Q