3v4l.org

run code in 300+ PHP versions simultaneously
<?php $datesarray = array('2012-10-01', '2012-10-03', '2012-10-04', '2012-10-05', '2012-10-08', '2012-10-09'); $count = 0; $result = "Nothing found"; foreach ($datesarray as $value) { if(strtotime($datesarray[$count]) - strtotime($datesarray[$count-1]) - strtotime($datesarray[$count-2]) == -1349150400) { $result = "3 Consecutive dates found"; } $count++; } echo "Result: $result";
Output for git.master, git.master_jit, rfc.property-hooks
Warning: Undefined array key -1 in /in/fnI3a on line 9 Deprecated: strtotime(): Passing null to parameter #1 ($datetime) of type string is deprecated in /in/fnI3a on line 9 Warning: Undefined array key -2 in /in/fnI3a on line 9 Deprecated: strtotime(): Passing null to parameter #1 ($datetime) of type string is deprecated in /in/fnI3a on line 9 Warning: Undefined array key -1 in /in/fnI3a on line 9 Deprecated: strtotime(): Passing null to parameter #1 ($datetime) of type string is deprecated in /in/fnI3a on line 9 Result: Nothing found

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