3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $now = new DateTime(); echo $now->modify('-30 years')->format('Y-m-d') . "\n"; echo $now->modify('-30 years')->format('Y-m-d');
based on 6Dfhb
Output for 5.3.0 - 5.4.34, 5.6.28, 7.0.14 - 7.1.0
1984-10-22 1954-10-22
Output for 7.0.6
1986-05-03 1956-05-03
Output for 5.6.14, 7.0.5
1986-04-02 1956-04-02
Output for 7.0.4
1986-03-10 1956-03-10
Output for 7.0.3
1986-03-18 1956-03-18
Output for 7.0.2
1986-03-22 1956-03-22
Output for 7.0.1
1986-03-23 1956-03-23
Output for 7.0.0
1986-03-26 1956-03-26
Output for hhvm-3.12.0
1986-03-12 1956-03-12
Output for hhvm-3.10.0

Process exited with code 153.
Output for 5.6.21
1986-05-02 1956-05-02
Output for 5.6.20
1986-04-09 1956-04-09
Output for 5.6.19
1986-03-07 1956-03-07
Output for 5.6.18
1986-03-15 1956-03-15
Output for 5.6.17
1986-03-19 1956-03-19
Output for 5.6.16
1986-03-28 1956-03-28
Output for 5.6.15
1986-03-29 1956-03-29
Output for 5.6.13
1986-04-15 1956-04-15
Output for 5.6.12
1986-04-19 1956-04-19
Output for 5.6.11
1986-04-23 1956-04-23
Output for 5.6.10
1986-04-25 1956-04-25
Output for 5.6.9
1986-04-27 1956-04-27
Output for 5.6.8
1986-04-29 1956-04-29
Output for 5.5.35
1986-05-22 1956-05-22
Output for 5.5.34
1986-04-11 1956-04-11
Output for 5.5.33
1986-03-08 1956-03-08
Output for 5.5.32
1986-03-17 1956-03-17
Output for 5.5.31
1986-03-20 1956-03-20
Output for 5.5.30
1986-04-01 1956-04-01
Output for 5.5.29
1986-04-16 1956-04-16
Output for 5.5.28
1986-04-21 1956-04-21
Output for 5.5.27
1986-04-22 1956-04-22
Output for 5.5.26
1986-04-26 1956-04-26
Output for 5.5.25
1986-04-28 1956-04-28
Output for 5.5.24
1986-05-23 1956-05-23
Output for 5.4.43 - 5.4.45
1985-09-06 1955-09-06
Output for 5.4.35 - 5.4.42
1985-07-09 1955-07-09
Output for 5.2.0 - 5.2.17
Fatal error: Call to a member function format() on a non-object in /in/8LY9a on line 5
Process exited with code 255.
Output for 5.0.0 - 5.1.6
Fatal error: Class 'DateTime' not found in /in/8LY9a on line 3
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/8LY9a on line 5
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/8LY9a on line 5
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error, expecting `','' or `';'' in /in/8LY9a on line 5
Process exited with code 255.