3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $birthday = date('Y-m-d', strtotime('2015-02-01')); $birthDate = explode($birthday, '-'); $age = (date("md", date("U", mktime(0, 0, 0, $birthDate[0], $birthDate[1], $birthDate[2]))) > date("md") ? ((date("Y") - $birthDate[2]) - 1) : (date("Y") - $birthDate[2]));
based on YndbP
Output for 7.0.0 - 7.2.0
Notice: Undefined offset: 1 in /in/4bcNj on line 5 Notice: Undefined offset: 2 in /in/4bcNj on line 5 Warning: mktime() expects parameter 4 to be integer, string given in /in/4bcNj on line 5 Notice: Undefined offset: 2 in /in/4bcNj on line 7
Output for 5.4.0 - 5.6.28
Notice: Undefined offset: 1 in /in/4bcNj on line 5 Notice: Undefined offset: 2 in /in/4bcNj on line 5 Warning: mktime() expects parameter 4 to be long, string given in /in/4bcNj on line 5 Notice: Undefined offset: 2 in /in/4bcNj on line 7