<?php function double($x) { echo 2*$x, PHP_EOL;} $array = [1, 2, 3, 4]; foreach ($array as $x) { double($x);}
Standard input is empty
2 4 6 8
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!