3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = array(9,4,-3,-10); function stddev($array){ //Don Knuth is the $deity of algorithms //http://en.wikipedia.org/wiki/Algorithms_for_calculating_variance#III._On-line_algorithm $n = 0; $mean = 0; $M2 = 0; foreach($array as $x){ $n++; $delta = $x - $mean; $mean = $mean + $delta/$n; $M2 = $M2 + $delta*($x - $mean); } $variance = $M2/($n - 1); return sqrt($variance); } ?>
Output for git.master, git.master_jit, rfc.property-hooks

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