3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php /** * Sum byte values from $start of $str **/ function sum($str, $start) { $sum = 0; $i = $start; for ( $max = strlen($str); $i < $max; ++$i) { $sum += ord($str[$i]); } return $sum; } $str = 'hello world'; echo sum($str, strpos($str, ' '));
Output for 4.3.0 - 5.6.28, hhvm-3.12.0, 7.0.0 - 7.1.0
584
Output for hhvm-3.10.0

Process exited with code 153.