3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $date = date_create()->modify('1'); echo $date->format('d.m.Y H:i:s');
based on rjMls
Output for 7.0.0 - 7.2.0
Warning: DateTime::modify(): Failed to parse time string (1) at position 0 (1): Unexpected character in /in/pSKXt on line 3 Fatal error: Uncaught Error: Call to a member function format() on boolean in /in/pSKXt:4 Stack trace: #0 {main} thrown in /in/pSKXt on line 4
Process exited with code 255.
Output for 5.6.8 - 5.6.28
Warning: DateTime::modify(): Failed to parse time string (1) at position 0 (1): Unexpected character in /in/pSKXt on line 3 Fatal error: Call to a member function format() on boolean in /in/pSKXt on line 4
Process exited with code 255.
Output for 5.3.18 - 5.5.35
Warning: DateTime::modify(): Failed to parse time string (1) at position 0 (1): Unexpected character in /in/pSKXt on line 3 Fatal error: Call to a member function format() on a non-object in /in/pSKXt on line 4
Process exited with code 255.