3v4l.org

run code in 300+ PHP versions simultaneously
<?php class dateCalculation { public $use_date; function __construct($date=null) { if(!empty($date)) { $this->$use_date = $date; } else { $this->$use_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->$use_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); } } echo date('Y-m-d H:i:s'); $dateCalculation = new dateCalculation(date('Y-m-d H:i:s')); echo $dateCalculation->validNextDrawDate();
Output for git.master, git.master_jit, rfc.property-hooks
2015-09-18 19:43:46 Warning: Undefined variable $use_date in /in/rKG6r on line 10 Deprecated: Creation of dynamic property dateCalculation::$ is deprecated in /in/rKG6r on line 10 Warning: Undefined variable $use_date in /in/rKG6r on line 20 2015-09-23 20:00

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:
42.94 ms | 402 KiB | 8 Q