Created
October 5, 2017 01:25
-
-
Save suzuken/e579861d4b0592ead83703076c0f04f5 to your computer and use it in GitHub Desktop.
This file contains 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 | |
class A { | |
public $a = 1; | |
} | |
$a = new A; | |
var_dump($a); | |
$b = $a; | |
$c = clone $a; | |
$a->a = 2; | |
var_dump($b); | |
var_dump($c); | |
// 2017object(A)#2 (1) { | |
// ["a"]=> | |
// int(1) | |
// } | |
// object(A)#2 (1) { | |
// ["a"]=> | |
// int(2) | |
// } | |
// object(A)#3 (1) { | |
// ["a"]=> | |
// int(1) | |
// } | |
// |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment