3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $date = new DateTime(); echo $date->add(new DateInterval('P1D'))->format('d'); echo $date->format('d');
based on pbred
Output for 5.6.28, 7.0.14 - 7.1.0
0707
Output for 7.0.6
0404
Output for 5.6.14, 5.6.21, 7.0.5
0303
Output for 5.5.34, 7.0.4
1111
Output for 7.0.3
1919
Output for 5.5.27, 5.5.35, 7.0.2
2323
Output for 5.5.24, 5.6.11, 7.0.1
2424
Output for 5.5.26, 7.0.0
2727
Output for 5.6.20
1010
Output for 5.6.19
0808
Output for 5.6.13, 5.6.18
1616
Output for 5.6.12, 5.6.17
2020
Output for 5.6.9, 5.6.16
2828
Output for 5.6.8, 5.6.15
3030
Output for 5.6.10
2626
Output for 5.5.33
0909
Output for 5.5.32
1818
Output for 5.5.28, 5.5.31
2121
Output for 5.3.0 - 5.4.45, 5.5.30
0202
Output for 5.5.29
1717
Output for 5.5.25
2929
Output for 5.2.0 - 5.2.17
Fatal error: Call to undefined method DateTime::add() in /in/Xanab on line 3
Process exited with code 255.
Output for 5.0.0 - 5.1.6
Fatal error: Class 'DateTime' not found in /in/Xanab on line 2
Process exited with code 255.
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected T_OBJECT_OPERATOR, expecting ',' or ';' in /in/Xanab on line 3
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1
Parse error: parse error, unexpected T_OBJECT_OPERATOR, expecting ',' or ';' in /in/Xanab on line 3
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error, expecting `','' or `';'' in /in/Xanab on line 3
Process exited with code 255.