3v4l.org

run code in 300+ PHP versions simultaneously
<?php echo (new DateTime())->format('Y-m-d'); echo (new DateTime('2014-09-05 13:18:26'))->format('Y-m-d'); $azi = (new DateTime())->format('Y-m-d'); $azi->sub(new DateInterval('P5D')); $lead_time= (new DateTime('2014-09-05 13:18:26'))->format('Y-m-d'); if($lead_time<$azi){ // Leaduri mai vechi $l_class=""; }else{ // Leaduri Fresh $l_class="fresh_leads"; echo "Fresh"; } /* $azi->sub(new DateInterval('P5D')); echo $azi; */
Output for 7.0.14 - 7.0.20, 7.1.0 - 7.1.25, 7.2.0 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.6
2014-09-102014-09-05 Fatal error: Uncaught Error: Call to a member function sub() on string in /in/5JXAO:6 Stack trace: #0 {main} thrown in /in/5JXAO on line 6
Process exited with code 255.
Output for 7.0.6
2016-05-032014-09-05 Fatal error: Uncaught Error: Call to a member function sub() on string in /in/5JXAO:6 Stack trace: #0 {main} thrown in /in/5JXAO on line 6
Process exited with code 255.
Output for 7.0.5
2016-04-032014-09-05 Fatal error: Uncaught Error: Call to a member function sub() on string in /in/5JXAO:6 Stack trace: #0 {main} thrown in /in/5JXAO on line 6
Process exited with code 255.
Output for 7.0.4
2016-03-102014-09-05 Fatal error: Uncaught Error: Call to a member function sub() on string in /in/5JXAO:6 Stack trace: #0 {main} thrown in /in/5JXAO on line 6
Process exited with code 255.
Output for 7.0.3
2016-03-182014-09-05 Fatal error: Uncaught Error: Call to a member function sub() on string in /in/5JXAO:6 Stack trace: #0 {main} thrown in /in/5JXAO on line 6
Process exited with code 255.
Output for 7.0.2
2016-03-232014-09-05 Fatal error: Uncaught Error: Call to a member function sub() on string in /in/5JXAO:6 Stack trace: #0 {main} thrown in /in/5JXAO on line 6
Process exited with code 255.
Output for 7.0.1
2016-03-242014-09-05 Fatal error: Uncaught Error: Call to a member function sub() on string in /in/5JXAO:6 Stack trace: #0 {main} thrown in /in/5JXAO on line 6
Process exited with code 255.
Output for 7.0.0
2016-03-272014-09-05 Fatal error: Uncaught Error: Call to a member function sub() on string in /in/5JXAO:6 Stack trace: #0 {main} thrown in /in/5JXAO on line 6
Process exited with code 255.
Output for 5.6.28
2014-09-102014-09-05 Fatal error: Call to a member function sub() on string in /in/5JXAO on line 6
Process exited with code 255.
Output for 5.6.21
2016-05-022014-09-05 Fatal error: Call to a member function sub() on string in /in/5JXAO on line 6
Process exited with code 255.
Output for 5.6.20
2016-04-102014-09-05 Fatal error: Call to a member function sub() on string in /in/5JXAO on line 6
Process exited with code 255.
Output for 5.6.19
2016-03-082014-09-05 Fatal error: Call to a member function sub() on string in /in/5JXAO on line 6
Process exited with code 255.
Output for 5.6.18
2016-03-152014-09-05 Fatal error: Call to a member function sub() on string in /in/5JXAO on line 6
Process exited with code 255.
Output for 5.6.17
2016-03-192014-09-05 Fatal error: Call to a member function sub() on string in /in/5JXAO on line 6
Process exited with code 255.
Output for 5.6.16
2016-03-282014-09-05 Fatal error: Call to a member function sub() on string in /in/5JXAO on line 6
Process exited with code 255.
Output for 5.6.15
2016-03-292014-09-05 Fatal error: Call to a member function sub() on string in /in/5JXAO on line 6
Process exited with code 255.
Output for 5.6.14
2016-04-022014-09-05 Fatal error: Call to a member function sub() on string in /in/5JXAO on line 6
Process exited with code 255.
Output for 5.6.13
2016-04-152014-09-05 Fatal error: Call to a member function sub() on string in /in/5JXAO on line 6
Process exited with code 255.
Output for 5.6.12
2016-04-202014-09-05 Fatal error: Call to a member function sub() on string in /in/5JXAO on line 6
Process exited with code 255.
Output for 5.6.11
2016-04-242014-09-05 Fatal error: Call to a member function sub() on string in /in/5JXAO on line 6
Process exited with code 255.
Output for 5.6.10
2016-04-252014-09-05 Fatal error: Call to a member function sub() on string in /in/5JXAO on line 6
Process exited with code 255.
Output for 5.6.9
2016-04-272014-09-05 Fatal error: Call to a member function sub() on string in /in/5JXAO on line 6
Process exited with code 255.
Output for 5.6.8
2016-04-302014-09-05 Fatal error: Call to a member function sub() on string in /in/5JXAO on line 6
Process exited with code 255.
Output for 5.5.35
2016-05-222014-09-05 Fatal error: Call to a member function sub() on a non-object in /in/5JXAO on line 6
Process exited with code 255.
Output for 5.5.34
2016-04-112014-09-05 Fatal error: Call to a member function sub() on a non-object in /in/5JXAO on line 6
Process exited with code 255.
Output for 5.5.33
2016-03-092014-09-05 Fatal error: Call to a member function sub() on a non-object in /in/5JXAO on line 6
Process exited with code 255.
Output for 5.5.32
2016-03-172014-09-05 Fatal error: Call to a member function sub() on a non-object in /in/5JXAO on line 6
Process exited with code 255.
Output for 5.5.31
2016-03-212014-09-05 Fatal error: Call to a member function sub() on a non-object in /in/5JXAO on line 6
Process exited with code 255.
Output for 5.5.30
2016-04-012014-09-05 Fatal error: Call to a member function sub() on a non-object in /in/5JXAO on line 6
Process exited with code 255.
Output for 5.5.29
2016-04-172014-09-05 Fatal error: Call to a member function sub() on a non-object in /in/5JXAO on line 6
Process exited with code 255.
Output for 5.5.28
2016-04-212014-09-05 Fatal error: Call to a member function sub() on a non-object in /in/5JXAO on line 6
Process exited with code 255.
Output for 5.5.27
2016-04-222014-09-05 Fatal error: Call to a member function sub() on a non-object in /in/5JXAO on line 6
Process exited with code 255.
Output for 5.5.26
2016-04-262014-09-05 Fatal error: Call to a member function sub() on a non-object in /in/5JXAO on line 6
Process exited with code 255.
Output for 5.5.25
2016-04-282014-09-05 Fatal error: Call to a member function sub() on a non-object in /in/5JXAO on line 6
Process exited with code 255.
Output for 5.5.24
2016-05-242014-09-05 Fatal error: Call to a member function sub() on a non-object in /in/5JXAO on line 6
Process exited with code 255.
Output for 5.4.39 - 5.4.45
2015-09-212014-09-05 Fatal error: Call to a member function sub() on a non-object in /in/5JXAO on line 6
Process exited with code 255.
Output for 5.4.34 - 5.4.38
2015-03-142014-09-05 Fatal error: Call to a member function sub() on a non-object in /in/5JXAO on line 6
Process exited with code 255.
Output for 5.4.0 - 5.4.32
2014-09-102014-09-05 Fatal error: Call to a member function sub() on a non-object in /in/5JXAO on line 6
Process exited with code 255.
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.1.6, 5.2.0 - 5.2.17, 5.3.0 - 5.3.29
Parse error: syntax error, unexpected T_OBJECT_OPERATOR, expecting ',' or ';' in /in/5JXAO on line 2
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.3.11, 4.4.0 - 4.4.1, 5.0.0 - 5.0.5
Parse error: parse error, unexpected T_OBJECT_OPERATOR, expecting ',' or ';' in /in/5JXAO on line 2
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error, expecting `','' or `';'' in /in/5JXAO on line 2
Process exited with code 255.

preferences:
240.59 ms | 401 KiB | 327 Q