3v4l.org

run code in 300+ PHP versions simultaneously
<?php $days_allowed = array('ID' => '1', 'monday' => '1', 'tuesday' => '1', 'wednesday' => '1', 'thursday' => '1', 'friday' => '1', 'saturday' => '0', 'sunday' => '0'); $days = array(); if($days_allowed["monday"] == 1) { array_push($days, '1'); } if($days_allowed["tuesday"] == 1) { array_push($days, '2'); } if($days_allowed["wednesday"] == 1) { array_push($days, '3'); } if($days_allowed["thursday"] == 1) { array_push($days, '4'); } if($days_allowed["friday"] == 1) { array_push($days, '5'); } if($days_allowed["saturday"] == 1) { array_push($days, '6'); } if($days_allowed["sunday"] == 1) { array_push($days, '0'); } //if (!($_hebeproductionDeliveryDate->format("w") == 2 || $_hebeproductionDeliveryDate->format("w") == 4 || $_hebeproductionDeliveryDate->format("w") == 6)) { if (!(in_array($_hebeproductionDeliveryDate->format("w"), $days))) { echo "do error"; }
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 $_hebeproductionDeliveryDate in /in/BX0mr on line 31 Fatal error: Uncaught Error: Call to a member function format() on null in /in/BX0mr:31 Stack trace: #0 {main} thrown in /in/BX0mr on line 31
Process exited with code 255.
Output for 7.1.25 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.31, 7.4.0 - 7.4.33
Notice: Undefined variable: _hebeproductionDeliveryDate in /in/BX0mr on line 31 Fatal error: Uncaught Error: Call to a member function format() on null in /in/BX0mr:31 Stack trace: #0 {main} thrown in /in/BX0mr on line 31
Process exited with code 255.
Output for 7.3.32 - 7.3.33
Fatal error: Uncaught Error: Call to a member function format() on null in /in/BX0mr:31 Stack trace: #0 {main} thrown in /in/BX0mr on line 31
Process exited with code 255.

preferences:
166.92 ms | 401 KiB | 180 Q