3v4l.org

run code in 300+ PHP versions simultaneously
<?php $now = new DateTime(); $formatted = ""; $arrFormattedBDays = []; $birthdays = ['18-Jul-46','19-Aug-47','1-Jan-19','31-Dec-18']; foreach ($birthdays as $b){ $dt = new DateTime($b); var_dump($dt); $formatted = $dt->format('d/m/19y'); $arrFormattedBDays[] = $formatted; } var_dump($arrFormattedBDays);
Output for git.master, git.master_jit, rfc.property-hooks
object(DateTime)#2 (3) { ["date"]=> string(26) "2046-07-18 00:00:00.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#3 (3) { ["date"]=> string(26) "2047-08-19 00:00:00.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#2 (3) { ["date"]=> string(26) "2019-01-01 00:00:00.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#3 (3) { ["date"]=> string(26) "2018-12-31 00:00:00.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } array(4) { [0]=> string(10) "18/07/1946" [1]=> string(10) "19/08/1947" [2]=> string(10) "01/01/1919" [3]=> string(10) "31/12/1918" }

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:
122.11 ms | 407 KiB | 5 Q