3v4l.org

run code in 300+ PHP versions simultaneously
<?php date_default_timezone_set('America/New_York'); $date = new DateTime(); echo json_encode($date,JSON_FORCE_OBJECT); var_dump(json_last_error(), json_last_error_msg()); function check($name) { $o = new $name('now', new DateTimeZone('UTC')); echo json_encode($o); $s = serialize($o); echo json_encode($s); var_dump(isset($o2->_date_time) === false); } check('DateTime'); class A extends DateTime {} check('A');
Output for git.master
{"date":"2014-06-19 23:22:02.004140","timezone_type":3,"timezone":"America\/New_York"}int(0) string(8) "No error" {"date":"2014-06-20 03:22:02.004180","timezone_type":3,"timezone":"UTC"}"O:8:\"DateTime\":3:{s:4:\"date\";s:26:\"2014-06-20 03:22:02.004180\";s:13:\"timezone_type\";i:3;s:8:\"timezone\";s:3:\"UTC\";}"bool(true) {"date":"2014-06-20 03:22:02.004195","timezone_type":3,"timezone":"UTC"}"O:1:\"A\":3:{s:4:\"date\";s:26:\"2014-06-20 03:22:02.004195\";s:13:\"timezone_type\";i:3;s:8:\"timezone\";s:3:\"UTC\";}"bool(true)
Output for git.master_jit
{"date":"2014-06-19 23:22:02.003877","timezone_type":3,"timezone":"America\/New_York"}int(0) string(8) "No error" {"date":"2014-06-20 03:22:02.003919","timezone_type":3,"timezone":"UTC"}"O:8:\"DateTime\":3:{s:4:\"date\";s:26:\"2014-06-20 03:22:02.003919\";s:13:\"timezone_type\";i:3;s:8:\"timezone\";s:3:\"UTC\";}"bool(true) {"date":"2014-06-20 03:22:02.003931","timezone_type":3,"timezone":"UTC"}"O:1:\"A\":3:{s:4:\"date\";s:26:\"2014-06-20 03:22:02.003931\";s:13:\"timezone_type\";i:3;s:8:\"timezone\";s:3:\"UTC\";}"bool(true)
Output for rfc.property-hooks
{"date":"2014-06-19 23:22:02.003780","timezone_type":3,"timezone":"America\/New_York"}int(0) string(8) "No error" {"date":"2014-06-20 03:22:02.003812","timezone_type":3,"timezone":"UTC"}"O:8:\"DateTime\":3:{s:4:\"date\";s:26:\"2014-06-20 03:22:02.003812\";s:13:\"timezone_type\";i:3;s:8:\"timezone\";s:3:\"UTC\";}"bool(true) {"date":"2014-06-20 03:22:02.003822","timezone_type":3,"timezone":"UTC"}"O:1:\"A\":3:{s:4:\"date\";s:26:\"2014-06-20 03:22:02.003822\";s:13:\"timezone_type\";i:3;s:8:\"timezone\";s:3:\"UTC\";}"bool(true)

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