3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function makecoffee($types = array("cappuccino"), $coffeeMaker = NULL) { $device = is_null($coffeeMaker) ? "hands" : $coffeeMaker; return "Making a cup of ".join(", ", $types)." with $device.\n"; } echo makecoffee(); echo makecoffee(array("cappuccino", "lavazza"), "teapot"); ?>
Output for 4.3.0 - 7.1.0
Making a cup of cappuccino with hands. Making a cup of cappuccino, lavazza with teapot.