3v4l.org

run code in 300+ PHP versions simultaneously
<?php class MyDateTime extends DateTime { public function setTimestamp( $timestamp ) { $date = getdate( ( int ) $timestamp ); $this->setDate( $date['year'] , $date['mon'] , $date['mday'] ); $this->setTime( $date['hours'] , $date['minutes'] , $date['seconds'] ); } public function getTimestamp() { return $this->format( 'U' ); } } $date = new MyDateTime(); $need_score = 248; $timestamp = 1417763475; $current_score = 0.7; $date_now = new DateTime(); $date = new MyDateTime(); $date->setTimestamp($timestamp); $interval_days = $date_now->diff($date)->days + 1; print ($need_score - $current_score) * $interval_days;
Output for git.master, git.master_jit, rfc.property-hooks
Deprecated: Return type of MyDateTime::setTimestamp($timestamp) should either be compatible with DateTime::setTimestamp(int $timestamp): DateTime, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /in/QgCar on line 5 Deprecated: Return type of MyDateTime::getTimestamp() should either be compatible with DateTime::getTimestamp(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /in/QgCar on line 12 67265.6

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