3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $yddd = 3212; preg_match('^(\d)(\d{3})$', $yddd, $m); echo date('Y-m-d', strtotime("201{$m[1]}-01-01 00:00:00 +{$m[2]} days"));
Output for 5.2.0 - 5.6.28, 7.0.0 - 7.1.0
Warning: preg_match(): No ending delimiter '^' found in /in/gpXG1 on line 4 1970-01-01
Output for hhvm-3.10.0 - 3.12.0
Warning: No ending delimiter '^' found: [^(\d)(\d{3})$] in /in/gpXG1 on line 4 1970-01-01
Output for 5.1.0 - 5.1.6
Warning: preg_match(): No ending delimiter '^' found in /in/gpXG1 on line 4 Notice: Undefined offset: 1 in /in/gpXG1 on line 6 Notice: Undefined offset: 2 in /in/gpXG1 on line 6 1970-01-01
Output for 4.3.11 - 5.0.5
Warning: preg_match(): No ending delimiter '^' found in /in/gpXG1 on line 4 Notice: Undefined offset: 1 in /in/gpXG1 on line 6 Notice: Undefined offset: 2 in /in/gpXG1 on line 6 201-01-02
Output for 4.3.0 - 4.3.10
Warning: No ending delimiter '^' found in /in/gpXG1 on line 4 Notice: Undefined offset: 1 in /in/gpXG1 on line 6 Notice: Undefined offset: 2 in /in/gpXG1 on line 6 201-01-02