3v4l.org

run code in 300+ PHP versions simultaneously
<?php function testFunction($var) { if ($var == 1) return "<div>Hello World from function1</div>"; if ($var == 7) return "<div>Hello World from function7</div>"; if ($var == 2) return "<div>Hello World from function2</div>"; if ($var == 3) return "<div>Hello World from function3</div>"; if ($var == 4) return "<div>Hello World from function4</div>"; if ($var == 5) return "<div>Hello World from function5</div>"; if ($var == 6) return "<div>Hello World from function6</div>"; } $functions1 = 7; //users can select this value and this can be something between 1-7 $functions2 = 5; //these values are positions to be precise $functions3 = 6; //no two variables can have same value as each position is unique $functions4 = 3; //we can also make $functions1-7 an array to avoid making 7 variables $functions5 = 4; $functions6 = 2; $functions7 = 1; $array = array($functions1, $functions2, $functions3, $functions4, $functions5, $functions6, $functions7); for ($i = 0; $i<count($array); $i++) echo testFunction($array[$i]);
Output for git.master, git.master_jit, rfc.property-hooks
<div>Hello World from function7</div><div>Hello World from function5</div><div>Hello World from function6</div><div>Hello World from function3</div><div>Hello World from function4</div><div>Hello World from function2</div><div>Hello World from function1</div>

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:
40.27 ms | 401 KiB | 8 Q