3v4l.org

run code in 300+ PHP versions simultaneously
<?php $wdUses = array(); $ssUses = array(); $monthArray = array(); $subTime = date('Y-m-d', strtotime('-1 years')); $currentTime = date('Y-m-d'); echo $subTime; $wdLog = AuditLog::findAllInDateRangeWithProductIdsAndActionId(date('y-m-d h', $subTime) ,$currentTime, 1, 1); $ssLog = AuditLog::findAllInDateRangeWithProductIdsAndActionId(date('y-m-d h', $subTime) ,$currentTime, 3, 1); for($i = 0; $i < 12; $i++) { $startTime = date('Y-m-d', strtotime('-$i months')); $endTime = date('Y-m-d', strtotime('-($i +1) months')); foreach ($wdLog as $log) { if( $log->getDateTime() >= $subtime && $log->getDateTime() < $endTime ) { ++$wdUses[$i]; } } foreach ($ssLog as $log) { if( $log->getDateTime() >= $subtime && $log->getDateTime() < $endTime ) { ++$ssUses[$i]; } } $monthArray[$i] = $startTime(); } $wdUses = json_encode($wdUses); $ssUses = json_encode($ssUses); $monthArray = json_encode($monthArray); echo $wdUses; ?>
Output for git.master, git.master_jit, rfc.property-hooks
2014-09-16 Fatal error: Uncaught Error: Class "AuditLog" not found in /in/o3kZW:12 Stack trace: #0 {main} thrown in /in/o3kZW on line 12
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:
53.26 ms | 401 KiB | 8 Q