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

Output for rfc.property-hooks, git.master, git.master_jit
Array ( [0] => stdClass Object ( [user_id] => 42 [tp] => 10 [days] => Monday [date] => DateTimeImmutable Object ( [date] => 2016-02-01 00:00:00.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) [working_hours] => 5 ) [1] => stdClass Object ( [user_id] => 42 [tp] => 10 [days] => Tuesday [date] => DateTimeImmutable Object ( [date] => 2016-02-02 00:00:00.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) [working_hours] => 5 ) [2] => stdClass Object ( [user_id] => 42 [tp] => 10 [days] => Wednesday [date] => DateTimeImmutable Object ( [date] => 2016-02-03 00:00:00.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) [working_hours] => 5 ) [3] => stdClass Object ( [user_id] => 42 [tp] => 10 [days] => Thursday [date] => DateTimeImmutable Object ( [date] => 2016-02-04 00:00:00.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) [working_hours] => 5 ) [4] => stdClass Object ( [user_id] => 42 [tp] => 10 [days] => Friday [date] => DateTimeImmutable Object ( [date] => 2016-02-05 00:00:00.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) [working_hours] => 5 ) [5] => stdClass Object ( [user_id] => 42 [tp] => 10 [days] => Saturday [date] => DateTimeImmutable Object ( [date] => 2016-02-06 00:00:00.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) [working_hours] => 5 ) [6] => stdClass Object ( [user_id] => 42 [tp] => 10 [days] => Sunday [date] => DateTimeImmutable Object ( [date] => 2016-02-07 00:00:00.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) [working_hours] => 5 ) [7] => stdClass Object ( [user_id] => 42 [tp] => 10 [days] => Monday [date] => DateTimeImmutable Object ( [date] => 2016-02-08 00:00:00.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) [working_hours] => 5 ) [8] => stdClass Object ( [user_id] => 42 [tp] => 10 [days] => Tuesday [date] => DateTimeImmutable Object ( [date] => 2016-02-09 00:00:00.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) [working_hours] => 5 ) [9] => stdClass Object ( [user_id] => 42 [tp] => 10 [days] => Wednesday [date] => DateTimeImmutable Object ( [date] => 2016-02-10 00:00:00.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) [working_hours] => 5 ) [10] => stdClass Object ( [user_id] => 42 [tp] => 10 [days] => Thursday [date] => DateTimeImmutable Object ( [date] => 2016-02-11 00:00:00.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) [working_hours] => 5 ) [11] => stdClass Object ( [user_id] => 42 [tp] => 10 [days] => Friday [date] => DateTimeImmutable Object ( [date] => 2016-02-12 00:00:00.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) [working_hours] => 5 ) [12] => stdClass Object ( [user_id] => 42 [tp] => 10 [days] => Saturday [date] => DateTimeImmutable Object ( [date] => 2016-02-13 00:00:00.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) [working_hours] => 5 ) [13] => stdClass Object ( [user_id] => 42 [tp] => 10 [days] => Sunday [date] => DateTimeImmutable Object ( [date] => 2016-02-14 00:00:00.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) [working_hours] => 5 ) [14] => stdClass Object ( [user_id] => 42 [tp] => 10 [days] => Monday [date] => DateTimeImmutable Object ( [date] => 2016-02-15 00:00:00.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) [working_hours] => 5 ) [15] => stdClass Object ( [user_id] => 42 [tp] => 10 [days] => Tuesday [date] => DateTimeImmutable Object ( [date] => 2016-02-16 00:00:00.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) [working_hours] => 5 ) [16] => stdClass Object ( [user_id] => 42 [tp] => 10 [days] => Wednesday [date] => DateTimeImmutable Object ( [date] => 2016-02-17 00:00:00.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) [working_hours] => 5 ) [17] => stdClass Object ( [user_id] => 42 [tp] => 10 [days] => Thursday [date] => DateTimeImmutable Object ( [date] => 2016-02-18 00:00:00.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) [working_hours] => 5 ) [18] => stdClass Object ( [user_id] => 42 [tp] => 10 [days] => Friday [date] => DateTimeImmutable Object ( [date] => 2016-02-19 00:00:00.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) [working_hours] => 5 ) [19] => stdClass Object ( [user_id] => 42 [tp] => 10 [days] => Saturday [date] => DateTimeImmutable Object ( [date] => 2016-02-20 00:00:00.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) [working_hours] => 5 ) [20] => stdClass Object ( [user_id] => 42 [tp] => 10 [days] => Sunday [date] => DateTimeImmutable Object ( [date] => 2016-02-21 00:00:00.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) [working_hours] => 5 ) [21] => stdClass Object ( [user_id] => 42 [tp] => 10 [days] => Monday [date] => DateTimeImmutable Object ( [date] => 2016-02-22 00:00:00.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) [working_hours] => 5 ) [22] => stdClass Object ( [user_id] => 42 [tp] => 10 [days] => Tuesday [date] => DateTimeImmutable Object ( [date] => 2016-02-23 00:00:00.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) [working_hours] => 5 ) [23] => stdClass Object ( [user_id] => 42 [tp] => 10 [days] => Wednesday [date] => DateTimeImmutable Object ( [date] => 2016-02-24 00:00:00.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) [working_hours] => 5 ) [24] => stdClass Object ( [user_id] => 42 [tp] => 10 [days] => Thursday [date] => DateTimeImmutable Object ( [date] => 2016-02-25 00:00:00.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) [working_hours] => 5 ) [25] => stdClass Object ( [user_id] => 42 [tp] => 10 [days] => Friday [date] => DateTimeImmutable Object ( [date] => 2016-02-26 00:00:00.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) [working_hours] => 5 ) [26] => stdClass Object ( [user_id] => 42 [tp] => 10 [days] => Saturday [date] => DateTimeImmutable Object ( [date] => 2016-02-27 00:00:00.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) [working_hours] => 5 ) [27] => stdClass Object ( [user_id] => 42 [tp] => 10 [days] => Sunday [date] => DateTimeImmutable Object ( [date] => 2016-02-28 00:00:00.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) [working_hours] => 5 ) )

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:
66.75 ms | 4353 KiB | 4 Q