3v4l.org

run code in 300+ PHP versions simultaneously
<?php class dateCalculation { public $current_date; function __construct($date=null) { if(!emtpy($date)) { $this->current_date = $date; } else { $this->current_date = date('Y-m-d H:i:s'); } } public function validNextDrawDate() { $next_valid_date_time_1 = strtotime('this wednesday 20:00'); $next_valid_date_time_2 = strtotime('this saturday 20:00'); if(strtotime($this->current_date) < $next_valid_date_time_1) { // Past wednesday 20:00 of this week. $appointment_date_time = $next_valid_date_time_1; } else { $appointment_date_time = $next_valid_date_time_2; } echo date('Y-m-d H:i', $appointment_date_time); } } $dateCalculation = new dateCalculation(date('Y-m-d H:i:s')); echo $dateCalculation->validNextDrawDate();
Output for 7.0.0 - 7.0.20, 7.1.0 - 7.1.25, 7.2.0 - 7.2.33, 7.3.0 - 7.3.31, 7.4.0 - 7.4.33, 8.0.0 - 8.0.12, 8.0.14 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.6
Fatal error: Uncaught Error: Call to undefined function emtpy() in /in/UtO4V:9 Stack trace: #0 /in/UtO4V(32): dateCalculation->__construct('2015-09-18 19:4...') #1 {main} thrown in /in/UtO4V on line 9
Process exited with code 255.
Output for 7.3.32 - 7.3.33, 8.0.13
Fatal error: Uncaught Error: Call to undefined function emtpy() in /in/UtO4V:9 Stack trace: #0 /in/UtO4V(32): dateCalculation->__construct('2015-09-18 17:4...') #1 {main} thrown in /in/UtO4V on line 9
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
Fatal error: Call to undefined function emtpy() in /in/UtO4V on line 9
Process exited with code 255.

preferences:
223.67 ms | 402 KiB | 283 Q