Created
September 19, 2012 16:36
-
-
Save giorgiosironi/3750655 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function byReference(&$d) | |
{ | |
$d = new DateTime('1990-01-01'); | |
} | |
function byValue($d) | |
{ | |
$d = new DateTime('1990-01-01'); | |
} | |
$date = new DateTime('2011-03-04'); | |
byReference($date); | |
echo '$date: ' . $date->format('Y-m-d'); | |
$date = new DateTime('2011-03-04'); | |
byValue($date); | |
echo '$date: ' . $date->format('Y-m-d'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment