3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $month=(new \DateTime())->format('m'); $day=(new \DateTime())->format('d'); $year=(new \DateTime())->format('y'); if ($year % 2 == 0) { $yr=01; } else { $yr=02; } echo ($month.$day.$yr); ?>
based on b8CWj
Output for 5.4.0 - 5.4.32, 5.6.28, 7.0.14 - 7.1.0
10161
Output for 7.0.6
05031
Output for 5.6.14, 7.0.5
04021
Output for 7.0.4
03101
Output for 7.0.3
03181
Output for 7.0.2
03221
Output for 7.0.1
03231
Output for 7.0.0
03261
Output for 5.6.21
05021
Output for 5.6.20
04091
Output for 5.6.19
03071
Output for 5.6.18
03151
Output for 5.6.17
03191
Output for 5.6.16
03281
Output for 5.6.15
03291
Output for 5.6.13
04151
Output for 5.6.12
04191
Output for 5.6.11
04231
Output for 5.6.10
04251
Output for 5.6.9
04271
Output for 5.6.8
04291
Output for 5.5.35
05221
Output for 5.5.34
04111
Output for 5.5.33
03081
Output for 5.5.32
03171
Output for 5.5.31
03201
Output for 5.5.30
04011
Output for 5.5.29
04161
Output for 5.5.28
04211
Output for 5.5.27
04221
Output for 5.5.26
04261
Output for 5.5.25
04281
Output for 5.5.24
05241
Output for 5.4.43 - 5.4.45
09202
Output for 5.4.34 - 5.4.42
07092
Output for 5.3.0 - 5.3.29
Parse error: syntax error, unexpected T_OBJECT_OPERATOR in /in/FbKQS on line 1
Process exited with code 255.
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.2.17
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/FbKQS on line 1 Parse error: syntax error, unexpected T_OBJECT_OPERATOR in /in/FbKQS on line 1
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1, 5.0.0 - 5.0.5
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/FbKQS on line 1 Parse error: parse error, unexpected T_OBJECT_OPERATOR in /in/FbKQS on line 1
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/FbKQS on line 1 Parse error: parse error in /in/FbKQS on line 1
Process exited with code 255.