3v4l.org

run code in 300+ PHP versions simultaneously
<?php $start = "07/01/2015-08/01/2015"; //split the start and end date in to 2 and compare both to a real date to make sure they're valid $newdate = explode("-", $start); echo 1; //make sure date 2 is set if(!isset($newdate[1])): echo "No date 2\n"; endif; //check if newdate 0 and 1 are real dates $date1 = DateTime::createFromFormat('M-d-Y', str_replace("/","-",$newdate[0])); $date2 = DateTime::createFromFormat('M-d-Y', str_replace("/","-",$newdate[1])); echo str_replace("/","-",$newdate[0]); //not valid dates if($date1 == false || $date2 == false): echo "Invalid dates\n"; endif; echo 4;
Output for git.master, git.master_jit, rfc.property-hooks
107-01-2015Invalid dates 4

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
55.51 ms | 401 KiB | 8 Q