3v4l.org

run code in 300+ PHP versions simultaneously
<?php define("chleb", 1.5); define("pepsi", 6.0); define("mleko", 2.5); define("piwo", 3.1); define("VAT", 1.23); $ile_chleb = 4; $ile_pepsi = 5; $ile_mleko = 3; $ile_piwo = 2; $chleb_netto = $ile_chleb*chleb; $pepsi_netto = $ile_pepsi*pepsi; $mleko_netto = $ile_mleko*mleko; $piwo_netto = $ile_piwo*piwo; $kwota_prod_netto = $chleb_netto + $pepsi_netto + $mleko_netto + $piwo_netto; $chleb_brutto = $chleb_netto*VAT; $pepsi_brutto = $pepsi_netto*VAT; $mleko_brutto = $mleko_netto*VAT; $piwo_brutto = $piwo_netto*VAT; $kwota_prod_brutto = $chleb_brutto+$pepsi_brutto+$mleko_brutto+$piwo_brutto; echo "Koszt " , $ile_chleb, " chleba kosztuje ", round($chleb_brutto, 2), "zl/n"; echo "Koszt " , $ile_mleko, " mleka kosztuje ", round($mleko_brutto, 2), "zl<br>"; echo "Koszt " , $ile_pepsi, " pepsi kosztuje ", round($pepsi_brutto, 2), "zl<br>"; echo "Koszt " , $ile_piwo, " piwa kosztuje ", round($piwo_brutto, 2), "zl<br>"; echo "Laczny koszt ", round($kwota_prod_brutto, 2), "zl<br>";

preferences:
57.01 ms | 402 KiB | 5 Q