Skip to content

Instantly share code, notes, and snippets.

@jzawadzki
Created August 20, 2021 22:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jzawadzki/5a453497564d7eb6ddfc570e0fc52647 to your computer and use it in GitHub Desktop.
Save jzawadzki/5a453497564d7eb6ddfc570e0fc52647 to your computer and use it in GitHub Desktop.
<?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