3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $data = [ [ 'a' => '12-02-1972', 'b' => 'bleh' ], [ 'a' => '2011-11-11', 'b' => 'bleh' ], [ 'a' => '12-12-1922', 'b' => 'bleh' ] ]; foreach($data as $k=>$v){ foreach($v as $key =>$val){ if (preg_match("/^(((0[13578]|1[02])\/(0[1-9]|[12]\d|3[01])\/((19|[2-9]\d)\d{2}))|((0[13456789]|1[012])\/(0[1-9]|[12]\d|30)\/((19|[2-9]\d)\d{2}))|(02\/(0[1-9]|1\d|2[0-8])\/((19|[2-9]\d)\d{2}))|(02\/29\/((1[6-9]|[2-9]\d)(0[48]|[2468][048]|[13579][26])|((16|[2468][048]|[3579][26])00))))$/",$val)) { echo "match!"; preg_replace("/^(((0[13578]|1[02])\/(0[1-9]|[12]\d|3[01])\/((19|[2-9]\d)\d{2}))|((0[13456789]|1[012])\/(0[1-9]|[12]\d|30)\/((19|[2-9]\d)\d{2}))|(02\/(0[1-9]|1\d|2[0-8])\/((19|[2-9]\d)\d{2}))|(02\/29\/((1[6-9]|[2-9]\d)(0[48]|[2468][048]|[13579][26])|((16|[2468][048]|[3579][26])00))))$/", "/^((((19|[2-9]\d)\d{2})\/(0[13578]|1[02])\/(0[1-9]|[12]\d|3[01]))|(((19|[2-9]\d)\d{2})\/(0[13456789]|1[012])\/(0[1-9]|[12]\d|30))|(((19|[2-9]\d)\d{2})\/02\/(0[1-9]|1\d|2[0-8]))|(((1[6-9]|[2-9]\d)(0[48]|[2468][048]|[13579][26])|((16|[2468][048]|[3579][26])00))\/02\/29))$/",$val); } } } echo $v .'<br>';
based on QSaSI
Output for 5.6.38, hhvm-3.18.5 - 3.21.3, 7.1.0 - 7.3.0rc3
Notice: Array to string conversion in /in/i3m4q on line 36 Array<br>
Output for hhvm-3.22.0
Notice: Array to string conversion in /in/i3m4q on line -1 Array<br>