3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $string = "9hsfgh563452"; preg_match_all("/[0-9]/",$string,$matches); echo "Array size: " . count($matches[0])."\n"; echo "Array size: " . sizeof($matches[0])."\n"; echo "Array sum: " . array_sum($matches[0])."\n"; print_r($matches[0]);
Output for 4.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
Array size: 7 Array size: 7 Array sum: 34 Array ( [0] => 9 [1] => 5 [2] => 6 [3] => 3 [4] => 4 [5] => 5 [6] => 2 )