3v4l.org

run code in 300+ PHP versions simultaneously
<?php $barcode = "1234567891"; preg_match_all('/(\w)(\w)/',$barcode,$oddEven); $even_sum = array_sum($oddEven[2]); $odd_sum = array_sum($oddEven[1]); var_Dump("Odd numbers", $oddEven[2]); var_Dump("Even numbers", $oddEven[2]); var_Dump("Odd sum", $odd_sum); var_Dump("Even sum", $even_sum);
Output for git.master, git.master_jit, rfc.property-hooks
string(11) "Odd numbers" array(5) { [0]=> string(1) "2" [1]=> string(1) "4" [2]=> string(1) "6" [3]=> string(1) "8" [4]=> string(1) "1" } string(12) "Even numbers" array(5) { [0]=> string(1) "2" [1]=> string(1) "4" [2]=> string(1) "6" [3]=> string(1) "8" [4]=> string(1) "1" } string(7) "Odd sum" int(25) string(8) "Even sum" int(21)

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:
110.08 ms | 406 KiB | 5 Q