3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $datepicker = "November 16, 2013"; //$date = DateTime::createFromFormat("MMM dd , yyyy",$datestring); /* $date = Date("M d, Y"); var_dump($date); */ $datetime = strtotime($datestring); var_dump(date('M',$datetime)); $datetime1 = new DateTime('2009-10-11'); $datetime2 = new DateTime(); $interval = $datetime->diff($datetime2); var_dump($interval);
Output for 7.0.0 - 7.1.0
Notice: Undefined variable: datestring in /in/SPpKf on line 11 string(3) "Jan" Fatal error: Uncaught Error: Call to a member function diff() on boolean in /in/SPpKf:17 Stack trace: #0 {main} thrown in /in/SPpKf on line 17
Process exited with code 255.
Output for hhvm-3.12.0
Notice: Undefined variable: datestring in /in/SPpKf on line 11 Warning: strtotime() expects parameter 1 to be string, null given in /in/SPpKf on line 11 string(3) "Jan" Fatal error: Uncaught exception 'BadMethodCallException' with message 'Call to a member function diff() on a non-object (boolean)' in /in/SPpKf:17 Stack trace: #0 {main}
Process exited with code 255.
Output for hhvm-3.10.0
Notice: Undefined variable: datestring in /in/SPpKf on line 11 string(3) "Jan" Fatal error: Uncaught exception 'BadMethodCallException' with message 'Call to a member function diff() on a non-object (boolean)' in /in/SPpKf:17 Stack trace: #0 {main}
Process exited with code 255.
Output for 5.6.0 - 5.6.28
Notice: Undefined variable: datestring in /in/SPpKf on line 11 string(3) "Jan" Fatal error: Call to a member function diff() on boolean in /in/SPpKf on line 17
Process exited with code 255.
Output for 5.2.0 - 5.5.38
Notice: Undefined variable: datestring in /in/SPpKf on line 11 string(3) "Jan" Fatal error: Call to a member function diff() on a non-object in /in/SPpKf on line 17
Process exited with code 255.
Output for 5.1.2 - 5.1.6
Notice: Undefined variable: datestring in /in/SPpKf on line 11 string(3) "Jan" Fatal error: Class 'DateTime' not found in /in/SPpKf on line 15
Process exited with code 255.
Output for 5.1.0 - 5.1.1
Notice: Undefined variable: datestring in /in/SPpKf on line 11 string(3) "Nov" Fatal error: Class 'DateTime' not found in /in/SPpKf on line 15
Process exited with code 255.
Output for 5.0.4 - 5.0.5
Notice: Undefined variable: datestring in /in/SPpKf on line 11 Warning: strtotime(): Called with an empty time parameter. in /in/SPpKf on line 11 string(3) "Jan" Fatal error: Class 'DateTime' not found in /in/SPpKf on line 15
Process exited with code 255.
Output for 5.0.1 - 5.0.3
Notice: Undefined variable: datestring in /in/SPpKf on line 11 Warning: strtotime(): Called with an empty time parameter. in /in/SPpKf on line 11 string(3) "Jan" Fatal error: Class 'DateTime' not found in /in/SPpKf on line 15
Process exited with code 255.
Output for 5.0.0
Notice: Undefined variable: datestring in /in/SPpKf on line 11 Notice: strtotime(): Called with empty time parameter in /in/SPpKf on line 11 string(3) "Nov" Fatal error: Class 'DateTime' not found in /in/SPpKf on line 15
Process exited with code 255.
Output for 4.3.2 - 4.4.9
Notice: Undefined variable: datestring in /in/SPpKf on line 11 Notice: strtotime(): Called with empty time parameter in /in/SPpKf on line 11 string(3) "Nov" Fatal error: Cannot instantiate non-existent class: datetime in /in/SPpKf on line 15
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Notice: Undefined variable: datestring in /in/SPpKf on line 11 Notice: strtotime() [http://www.php.net/function.strtotime]: Called with empty time parameter in /in/SPpKf on line 11 string(3) "Nov" Fatal error: Cannot instantiate non-existent class: datetime in /in/SPpKf on line 15