3v4l.org

run code in 300+ PHP versions simultaneously
<?php $activities= array("Date,Num_Days,Event,Location","3/3/2018,1,Rosary of the Unborn,In Front of Planned Parenthood","4/4/2018,2,Sell Raffle Tickets,St. Eugene Church"); $monthNames = array("January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"); $omonth = -1; $start = TRUE; print_r ($activities); print_r ($monthNames); print_r ($omonth); if ($start == True) {; print_r ("TRUE"); } $today = new DateTime("yesterday"); print_r ($today); $len_activities=sizeof($activities); for ($i = 1; $i < $len_activities; $i++) { $activity = $activities[$i]; print_r ($activity . "\n"); $activity = $activities[$i]; $activity_array = str_getcsv ($activity,",") ; print_r ($activity_array); $d = DateTime($activity_array[0]); print_r ($d); $month = date("n",$d); print_r ("\n".$month."\n"); }
Output for git.master, git.master_jit, rfc.property-hooks
Array ( [0] => Date,Num_Days,Event,Location [1] => 3/3/2018,1,Rosary of the Unborn,In Front of Planned Parenthood [2] => 4/4/2018,2,Sell Raffle Tickets,St. Eugene Church ) Array ( [0] => January [1] => February [2] => March [3] => April [4] => May [5] => June [6] => July [7] => August [8] => September [9] => October [10] => November [11] => December ) -1TRUEDateTime Object ( [date] => 2018-03-26 00:00:00.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) 3/3/2018,1,Rosary of the Unborn,In Front of Planned Parenthood Array ( [0] => 3/3/2018 [1] => 1 [2] => Rosary of the Unborn [3] => In Front of Planned Parenthood ) Fatal error: Uncaught Error: Call to undefined function DateTime() in /in/G6RqD:21 Stack trace: #0 {main} thrown in /in/G6RqD on line 21
Process exited with code 255.

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:
30.73 ms | 402 KiB | 8 Q