Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class MyClass
- {
- public int $property;
- }
- $obj = new MyClass();
- $obj->property = 1;
- $normal = $obj->property;
- $reference = &$obj->property; // always have same value
- $obj->property = 2; // update new value
- echo $normal . PHP_EOL;
- echo $reference . PHP_EOL;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement