Created
August 20, 2021 22:17
-
-
Save jzawadzki/5a453497564d7eb6ddfc570e0fc52647 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 | |
class Hello | |
{ | |
private string $secret | |
public function __construct(string $secret) | |
{ | |
$this->secret = $secret; | |
} | |
public function access(Hello $other) | |
{ | |
// We can access the private property (and even change it) of other object | |
var_dump($other->secret); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment