- Output for git.master_jit, git.master, rfc.property-hooks
- <?php namespace Zend\Stdlib;use DateTimeZone;class DateTime extends\DateTime{public function __construct($c='now',DateTimeZone $d=null){if(version_compare(PHP_VERSION,'5.3.7','>=')){return parent::__construct($c,$d);}if(!stristr($c,'last')&&!stristr($c,'first')){if($d){return parent::__construct($c,$d);}else{return parent::__construct($c);}}if($d){parent::__construct('now',$d);}else{parent::__construct('now');}$f->setTimestamp(strtotime($c,$f->getTimestamp()));return $f;}public function modify($g){if(version_compare(PHP_VERSION,'5.3.7','>=')){return parent::modify($g);}if(!stristr($g,'last')&&!stristr($g,'first')){return parent::modify($g);}$h=strtotime($g,$f->getTimestamp());if($h===false){return false;}$f->setTimestamp($h);return $f;}}class classDateTimeTest{protected $i=null;public function setup(){}public function teardown(){if($f->revertTz){date_default_timezone_set($f->revertTz);$f->revertTz=null;}}protected function setDefaultTz($j){if(!$f->revertTz){$f->revertTz=date_default_timezone_get();}date_default_timezone_set($j);}public function testBug62896and62561(){$f->setDefaultTz('GMT');$j=new DateTimeZone('Europe/Berlin');$k=new DateTime('@'.strtotime('2012-08-22 00:00:00 CEST'));$f->assertEquals('2012-08-21 22:00:00 GMT+0000 (offset 0)',$k->format('Y-m-d H:i:s T').' (offset '.$k->getOffset().")",'default tz is Amsterdam, date from timestamp, no timezone, after +0 days');$k->modify('+0 days');$f->assertEquals('2012-08-21 22:00:00 GMT+0000 (offset 0)',$k->format('Y-m-d H:i:s T').' (offset '.$k->getOffset().")",'default tz is Amsterdam, date from timestamp, no timezone, after +0 days');$k=new DateTime('@'.strtotime('2012-08-22 00:00:00 CEST'));$k->setTimezone($j);$f->assertEquals('2012-08-22 00:00:00 CEST (offset 7200)',$k->format('Y-m-d H:i:s T').' (offset '.$k->getOffset().")",'default tz is Amsterdam, date from timestamp, with timezone');$k->modify('+0 days');$f->assertEquals('2012-08-22 00:00:00 CEST (offset 7200)',$k->format('Y-m-d H:i:s T').' (offset '.$k->getOffset().")",'default tz is Amsterdam, date from timestamp, with timezone, after +0 days');$k=new DateTime('2012-08-22 00:00:00 CEST',$j);$f->assertEquals('2012-08-22 00:00:00 CEST (offset 7200)',$k->format('Y-m-d H:i:s T').' (offset '.$k->getOffset().")",'default tz is Amsterdam, date from a string, with timezone');$k->modify('+0 days');$k=new DateTime('2012-08-22 00:00:00 CEST',$j);$f->assertEquals('2012-08-22 00:00:00 CEST (offset 7200)',$k->format('Y-m-d H:i:s T').' (offset '.$k->getOffset().")",'default tz is Amsterdam, date from a string, with timezone, after +0 days');$f->setDefaultTz('Asia/Seoul');$j=new DateTimeZone('Europe/Berlin');$k=new DateTime('@'.strtotime('2012-08-22 00:00:00 CEST'));$f->assertEquals('2012-08-21 22:00:00 GMT+0000 (offset 0)',$k->format('Y-m-d H:i:s T').' (offset '.$k->getOffset().")",'default tz is Amsterdam, date from timestamp, no timezone, after +0 days');$k->modify('+0 days');$f->assertEquals('2012-08-21 22:00:00 GMT+0000 (offset 0)',$k->format('Y-m-d H:i:s T').' (offset '.$k->getOffset().")",'default tz is Amsterdam, date from timestamp, no timezone, after +0 days');$k=new DateTime('@'.strtotime('2012-08-22 00:00:00 CEST'));$k->setTimezone($j);$f->assertEquals('2012-08-22 00:00:00 CEST (offset 7200)',$k->format('Y-m-d H:i:s T').' (offset '.$k->getOffset().")",'default tz is Amsterdam, date from timestamp, with timezone');$k->modify('+0 days');$f->assertEquals('2012-08-22 00:00:00 CEST (offset 7200)',$k->format('Y-m-d H:i:s T').' (offset '.$k->getOffset().")",'default tz is Amsterdam, date from timestamp, with timezone, after +0 days');$k=new DateTime('2012-08-22 00:00:00 CEST',$j);$f->assertEquals('2012-08-22 00:00:00 CEST (offset 7200)',$k->format('Y-m-d H:i:s T').' (offset '.$k->getOffset().")",'default tz is Amsterdam, date from a string, with timezone');$k->modify('+0 days');$k=new DateTime('2012-08-22 00:00:00 CEST',$j);$f->assertEquals('2012-08-22 00:00:00 CEST (offset 7200)',$k->format('Y-m-d H:i:s T').' (offset '.$k->getOffset().")",'default tz is Amsterdam, date from a string, with timezone, after +0 days');}protected function assertEquals($l,$m,$n=null){if($l!=$m){throw new\Exception(($n?$n."\n":"")."\"$l\" != \"$m\"\n");}}}$o=new\ReflectionClass(__NAMESPACE__.'\classDateTimeTest');foreach($o->getMethods()as $p){if(substr($p->getShortName(),0,4)!=='test')continue;try{$q=new classDateTimeTest();$q->setup();$p->invoke($q);$q->teardown();}catch(\Exception $r){echo 'FAIL: '.$p->getShortName();$s=$r->getTrace();echo ' | line '.$s[0]['line']."\n";echo $r->getMessage()."\n";try{$q->teardown();}catch(\Exception $r){}continue;}echo 'PASS: '.$p->getShortName()."\n";}
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
- 2020-03-21 RFC: Is_Literal - declined
- 2020-12-04 Enumerations - included in PHP 8.1
- 2018-06-15 Typed Properties v2 - implemented in PHP 7.4
- 2016-08-12 Object typehint - included in PHP 7.2
- 2016-08-14 Arrow functions - withdrawn
- 2016-05-29 array_change_keys() - withdrawn
- 2016-04-19 Lexical scope support for anonymous classes - suspended
- 2016-04-17 Functional Interfaces - declined
- 2016-03-16 Typed Properties - superseded in favor of Typed Properties 2.0
- 2015-08-27 Callable Prototypes - declined
- 2015-05-01 Short Closures - declined / withdrawn in favor of Arrow Functions
- 2015-02-18 Scalar type hints v5 - included in PHP 7
- 2015-02-14 Union Types - declined
- 2013-09-22 Anonymous classes - included in PHP 7