3v4l.org

run code in 300+ PHP versions simultaneously
<?php function bar() { try { throw new RuntimeException('Foo'); return new DateTime('now'); } catch (Throwable $e) { } finally { return new DateTime('-1 week'); } } try { var_dump(bar()); } catch (RuntimeException $e) { var_dump($e); }
Output for 8.0.0beta3
object(DateTime)#2 (3) { ["date"]=> string(26) "2020-09-09 15:53:09.012483" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 8.0.0beta2
object(DateTime)#2 (3) { ["date"]=> string(26) "2020-09-09 15:53:09.009243" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 8.0.0beta1
object(DateTime)#2 (3) { ["date"]=> string(26) "2020-09-09 15:53:09.008720" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 8.0.0alpha3
object(DateTime)#2 (3) { ["date"]=> string(26) "2020-09-09 15:53:09.010255" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 8.0.0alpha2
object(DateTime)#2 (3) { ["date"]=> string(26) "2020-09-09 15:53:09.012825" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 8.0.0alpha1
object(DateTime)#2 (3) { ["date"]=> string(26) "2020-09-09 15:53:09.011301" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.4.10
object(DateTime)#2 (3) { ["date"]=> string(26) "2020-09-09 15:53:09.009408" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.4.9
object(DateTime)#2 (3) { ["date"]=> string(26) "2020-09-09 15:53:09.010990" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.4.8
object(DateTime)#2 (3) { ["date"]=> string(26) "2020-09-09 15:53:09.008747" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.4.7
object(DateTime)#2 (3) { ["date"]=> string(26) "2020-09-09 15:53:09.009728" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.4.6
object(DateTime)#2 (3) { ["date"]=> string(26) "2020-09-09 15:53:09.011900" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.4.5
object(DateTime)#2 (3) { ["date"]=> string(26) "2020-09-09 15:53:09.013943" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.4.4
object(DateTime)#2 (3) { ["date"]=> string(26) "2020-09-09 15:53:09.008608" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.4.3
object(DateTime)#2 (3) { ["date"]=> string(26) "2020-09-09 15:53:09.008681" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.4.2
object(DateTime)#2 (3) { ["date"]=> string(26) "2020-09-09 15:53:09.011444" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.4.1
object(DateTime)#2 (3) { ["date"]=> string(26) "2020-09-09 15:53:09.011859" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.4.0
object(DateTime)#2 (3) { ["date"]=> string(26) "2020-09-09 15:53:09.008086" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.3.22
object(DateTime)#2 (3) { ["date"]=> string(26) "2020-09-09 15:53:09.009248" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.3.21
object(DateTime)#2 (3) { ["date"]=> string(26) "2020-09-09 15:53:09.012402" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.3.20
object(DateTime)#2 (3) { ["date"]=> string(26) "2020-09-09 15:53:09.016414" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.3.19
object(DateTime)#2 (3) { ["date"]=> string(26) "2020-09-09 15:53:09.008586" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.3.18
object(DateTime)#2 (3) { ["date"]=> string(26) "2020-09-09 15:53:09.009456" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.2.29, 7.3.17
object(DateTime)#2 (3) { ["date"]=> string(26) "2020-09-09 15:53:09.009318" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.3.16
object(DateTime)#2 (3) { ["date"]=> string(26) "2020-09-09 15:53:09.008749" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.3.15
object(DateTime)#2 (3) { ["date"]=> string(26) "2020-09-09 15:53:09.008694" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.3.14
object(DateTime)#2 (3) { ["date"]=> string(26) "2020-09-09 15:53:09.010530" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.3.13
object(DateTime)#2 (3) { ["date"]=> string(26) "2020-09-09 15:53:09.008786" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.3.12
object(DateTime)#2 (3) { ["date"]=> string(26) "2020-09-09 15:53:09.008860" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.3.11
object(DateTime)#2 (3) { ["date"]=> string(26) "2020-09-09 15:53:09.008897" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.3.10
object(DateTime)#2 (3) { ["date"]=> string(26) "2020-09-09 15:53:09.009667" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.3.9
object(DateTime)#2 (3) { ["date"]=> string(26) "2020-09-09 15:53:09.008281" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.3.8
object(DateTime)#2 (3) { ["date"]=> string(26) "2020-09-09 15:53:09.009566" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.3.7
object(DateTime)#2 (3) { ["date"]=> string(26) "2020-09-09 15:53:09.008656" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.3.6
object(DateTime)#2 (3) { ["date"]=> string(26) "2020-09-09 15:53:09.011683" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.3.5
object(DateTime)#2 (3) { ["date"]=> string(26) "2020-09-09 15:53:09.013360" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.3.4
object(DateTime)#2 (3) { ["date"]=> string(26) "2020-09-09 15:53:09.009858" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.3.3
object(DateTime)#2 (3) { ["date"]=> string(26) "2020-09-09 15:53:09.014367" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.3.2
object(DateTime)#2 (3) { ["date"]=> string(26) "2020-09-09 15:53:09.009755" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.3.1
object(DateTime)#2 (3) { ["date"]=> string(26) "2020-09-09 15:53:09.009857" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.3.0
object(DateTime)#2 (3) { ["date"]=> string(26) "2020-09-09 15:53:09.009546" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.2.33
object(DateTime)#2 (3) { ["date"]=> string(26) "2020-09-09 15:53:09.009460" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.2.32
object(DateTime)#2 (3) { ["date"]=> string(26) "2020-09-09 15:53:09.013098" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.2.31
object(DateTime)#2 (3) { ["date"]=> string(26) "2020-09-09 15:53:09.012053" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.2.30
object(DateTime)#2 (3) { ["date"]=> string(26) "2020-09-09 15:53:09.008542" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.2.28
object(DateTime)#2 (3) { ["date"]=> string(26) "2020-09-09 15:53:09.008642" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.2.27
object(DateTime)#2 (3) { ["date"]=> string(26) "2020-09-09 15:53:09.008993" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.2.26
object(DateTime)#2 (3) { ["date"]=> string(26) "2020-09-09 15:53:09.009105" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.2.25
object(DateTime)#2 (3) { ["date"]=> string(26) "2020-09-09 15:53:09.008780" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.2.24
object(DateTime)#2 (3) { ["date"]=> string(26) "2020-09-09 15:53:09.010003" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.2.23
object(DateTime)#2 (3) { ["date"]=> string(26) "2020-09-09 15:53:09.008972" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.2.22
object(DateTime)#2 (3) { ["date"]=> string(26) "2020-09-09 15:53:09.009347" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.2.21
object(DateTime)#2 (3) { ["date"]=> string(26) "2020-09-09 15:53:09.011832" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.2.20
object(DateTime)#2 (3) { ["date"]=> string(26) "2020-09-09 15:53:09.009734" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.2.19
object(DateTime)#2 (3) { ["date"]=> string(26) "2020-09-09 15:53:09.010559" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.2.18
object(DateTime)#2 (3) { ["date"]=> string(26) "2020-09-09 15:53:09.011659" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.2.17
object(DateTime)#2 (3) { ["date"]=> string(26) "2020-09-09 15:53:09.015995" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.2.16
object(DateTime)#2 (3) { ["date"]=> string(26) "2020-09-09 15:53:09.011914" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.2.15
object(DateTime)#2 (3) { ["date"]=> string(26) "2020-09-09 15:53:09.010067" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.2.14
object(DateTime)#2 (3) { ["date"]=> string(26) "2020-09-09 15:53:09.011076" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.2.13
object(DateTime)#2 (3) { ["date"]=> string(26) "2020-09-09 15:53:09.009880" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.2.12
object(DateTime)#2 (3) { ["date"]=> string(26) "2020-09-09 15:53:09.010216" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.2.11
object(DateTime)#2 (3) { ["date"]=> string(26) "2020-09-09 15:53:09.009716" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.2.10
object(DateTime)#2 (3) { ["date"]=> string(26) "2020-09-09 15:53:09.016782" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.2.9
object(DateTime)#2 (3) { ["date"]=> string(26) "2020-09-09 15:53:09.018034" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.2.8
object(DateTime)#2 (3) { ["date"]=> string(26) "2020-09-09 15:53:09.018800" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.2.7
object(DateTime)#2 (3) { ["date"]=> string(26) "2020-09-09 15:53:09.010095" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.2.6
object(DateTime)#2 (3) { ["date"]=> string(26) "2020-09-09 15:53:09.009217" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.2.5
object(DateTime)#2 (3) { ["date"]=> string(26) "2020-09-09 15:53:09.013074" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.2.4
object(DateTime)#2 (3) { ["date"]=> string(26) "2020-09-09 15:53:09.009993" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.2.3
object(DateTime)#2 (3) { ["date"]=> string(26) "2020-09-09 15:53:09.035812" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.2.2
object(DateTime)#2 (3) { ["date"]=> string(26) "2020-09-09 15:53:09.013631" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.2.1
object(DateTime)#2 (3) { ["date"]=> string(26) "2020-09-09 15:53:09.009376" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.2.0
object(DateTime)#2 (3) { ["date"]=> string(26) "2020-09-09 15:53:09.010308" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }