3v4l.org

run code in 300+ PHP versions simultaneously
<?php $correctTimestamp = correctMondayTimestamp(); $time_query = "data_ordine BETWEEN DATE('".date("Y-m-d",$correctTimestamp)."') AND DATE_ADD(DATE('".date("Y-m-d",strtotime("sunday this week"))."'), INTERVAL 1 DAY)"; $begin = new DateTime(date("c", $correctTimestamp)); echo "TQ: $time_query\nB: ".date_format('U',$begin); function correctMondayTimestamp(){ if(date('N') == 7) { return strtotime('monday last week'); } else { return strtotime('monday this week'); } }
Output for git.master, git.master_jit, rfc.property-hooks
Fatal error: Uncaught TypeError: date_format(): Argument #1 ($object) must be of type DateTimeInterface, string given in /in/mlUTN:6 Stack trace: #0 /in/mlUTN(6): date_format('U', Object(DateTime)) #1 {main} thrown in /in/mlUTN on line 6
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:
66.16 ms | 401 KiB | 8 Q