3v4l.org

run code in 300+ PHP versions simultaneously
<?php foreach (array('19.03.2014','30.02.1980','1.1.1970','1781980', '04071792') as $value) { print("$value\n"); if (1 === preg_match('/^([0-3]?[0-9])\\.?([01]?[0-9])\\.?((19|20)[0-9][0-9])$/', trim($value), $matches)) { var_dump($matches); } else { print("No match\n"); } }
Output for git.master, git.master_jit, rfc.property-hooks
19.03.2014 array(5) { [0]=> string(10) "19.03.2014" [1]=> string(2) "19" [2]=> string(2) "03" [3]=> string(4) "2014" [4]=> string(2) "20" } 30.02.1980 array(5) { [0]=> string(10) "30.02.1980" [1]=> string(2) "30" [2]=> string(2) "02" [3]=> string(4) "1980" [4]=> string(2) "19" } 1.1.1970 array(5) { [0]=> string(8) "1.1.1970" [1]=> string(1) "1" [2]=> string(1) "1" [3]=> string(4) "1970" [4]=> string(2) "19" } 1781980 array(5) { [0]=> string(7) "1781980" [1]=> string(2) "17" [2]=> string(1) "8" [3]=> string(4) "1980" [4]=> string(2) "19" } 04071792 No match

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:
41.68 ms | 402 KiB | 8 Q