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); ?>
Output for 8.0.0 - 8.0.30, 8.1.0 - 8.1.27, 8.2.0 - 8.2.17, 8.3.0 - 8.3.4
Warning: Undefined variable $subtime in /in/eaocn on line 10 Fatal error: Uncaught Error: Class "AuditLog" not found in /in/eaocn:12 Stack trace: #0 {main} thrown in /in/eaocn on line 12
Process exited with code 255.
Output for 7.0.0 - 7.0.20, 7.1.0 - 7.1.20, 7.2.0 - 7.2.33, 7.3.16 - 7.3.31, 7.4.0 - 7.4.33
Notice: Undefined variable: subtime in /in/eaocn on line 10 Fatal error: Uncaught Error: Class 'AuditLog' not found in /in/eaocn:12 Stack trace: #0 {main} thrown in /in/eaocn on line 12
Process exited with code 255.
Output for 7.3.32 - 7.3.33
Fatal error: Uncaught Error: Class 'AuditLog' not found in /in/eaocn:12 Stack trace: #0 {main} thrown in /in/eaocn on line 12
Process exited with code 255.
Output for 5.4.0 - 5.4.45, 5.5.0 - 5.5.38, 5.6.0 - 5.6.28
Notice: Undefined variable: subtime in /in/eaocn on line 10 Fatal error: Class 'AuditLog' not found in /in/eaocn on line 12
Process exited with code 255.

preferences:
221.28 ms | 402 KiB | 265 Q