3v4l.org

run code in 300+ PHP versions simultaneously
<?php $user_id = 42; $month = 2; $year = 2016; $startDate = new DateTimeImmutable( sprintf("%d-%d-01 00:00:00", $year, $month) ); $daysInMonth = new DatePeriod( $startDate, new DateInterval('P1D'), $startDate->modify('last day of this month') ); foreach($daysInMonth as $day){ $data = new StdClass(); $data->user_id= $user_id; $data->tp = 10; $data->days= $day->format('l'); $data->date= $day; $data->working_hours = 5; $monthlyHour[] = $data; } print_r($monthlyHour);

Abusive script

This script was stopped while abusing our resources

This is an error 500

Value for `_results` contains invalid data `array`


preferences:
187.42 ms | 4966 KiB | 10 Q