3v4l.org

run code in 300+ PHP versions simultaneously
<?php $month=10; $year=2014; // Mantech $startDate = strtotime($month.'/1/'.$year); $stopDate = strtotime('last day of this month ',$startDate); if (date('D',$startDate)!='Sat'){ $startDate = strtotime('next saturday',$startDate); } if (date('D',$stopDate)!='Fri'){ $stopDate = strtotime('next friday',$stopDate); } echo (date('Y-m-d',$startDate).' - '.date('Y-m-d',$stopDate)."\n"); // If our startDate isn't a Monday, grab the previous Monday if (date('D',$startDate)!='Mon'){ $prevMonday = strtotime('last Monday',$startDate); } else { $prevMonday = $startDate; } // Format startweek as ISO8601 eg.2014W15 echo (date('Y-m-d',$prevMonday)."\n"); $beginWeek = date('o',$prevMonday).'W'.date('W',$prevMonday); echo ($beginWeek."\n"); echo (date('Y-m-d',strtotime($beginWeek))."\n"); $datediff=$stopDate-$startDate; $weeks=floor($datediff/(60*60*24)); echo $weeks for ($i=0; $i<=$weeks; $i++){ $thisWeek = strtotime($beginWeek.' +'.$i.' weeks'); echo (date('Y-m-d',$thisWeek)."\n"); $mask = ''; for ($j=0; $j<7; $j++){ $thisDay = strtotime('+'.$j.' days',$thisWeek); if ($startDate<=$thisDay or $thisDay<=$stopDate){ $mask=$mask.'1'; } else { $mask=$mask.'0'; } } echo $mask."\n"; }

Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).

VersionSystem time (s)User time (s)Memory (MiB)
5.4.300.0080.03812.50
5.4.290.0100.04312.50
5.4.280.0070.04212.40
5.4.270.0090.03412.40
5.4.260.0050.04012.40
5.4.250.0080.03612.40
5.4.240.0090.03912.40
5.4.230.0090.04112.39
5.4.220.0060.04212.39
5.4.210.0040.04212.39
5.4.200.0070.03712.39
5.4.190.0050.03712.39
5.4.180.0070.03512.39
5.4.170.0090.03412.40
5.4.160.0090.03712.39
5.4.150.0060.03612.39
5.4.140.0090.04712.08
5.4.130.0100.04412.06
5.4.120.0110.03612.03
5.4.110.0060.03912.02
5.4.100.0130.06912.03
5.4.90.0050.03812.02
5.4.80.0050.03912.02
5.4.70.0080.03912.02
5.4.60.0100.03312.02
5.4.50.0050.04312.02
5.4.40.0040.03712.01
5.4.30.0070.04312.00
5.4.20.0050.04112.00
5.4.10.0090.03912.00
5.4.00.0080.03611.50
5.3.280.0050.04412.71
5.3.270.0120.05512.72
5.3.260.0100.04412.72
5.3.250.0070.03612.72
5.3.240.0070.03512.72
5.3.230.0060.03812.71
5.3.220.0060.03812.68
5.3.210.0080.03512.68
5.3.200.0060.04112.68
5.3.190.0060.04212.68
5.3.180.0070.05012.68
5.3.170.0050.04012.67
5.3.160.0060.04412.67
5.3.150.0050.04412.67
5.3.140.0040.03812.66
5.3.130.0050.03912.66
5.3.120.0080.03612.66
5.3.110.0070.03712.66
5.3.100.0080.03512.12
5.3.90.0070.03512.09
5.3.80.0060.03712.07
5.3.70.0050.03812.07
5.3.60.0090.03412.06
5.3.50.0060.03612.00
5.3.40.0140.02812.00
5.3.30.0070.04411.96
5.3.20.0070.03411.74
5.3.10.0050.04411.70
5.3.00.0040.03711.70

preferences:
161.94 ms | 1394 KiB | 7 Q