Skip to content

Instantly share code, notes, and snippets.

@suin
Created March 16, 2019 05:10
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 suin/de21b09896bb8a7d60235ee4af32282e to your computer and use it in GitHub Desktop.
Save suin/de21b09896bb8a7d60235ee4af32282e to your computer and use it in GitHub Desktop.
<?php
class PHPer {
public $name = '???';
public $PHP力 = '???';
public function PHPを教える(PHPer $教え子) {
$教え子->PHP力 = '強い';
}
}
$hirosan = new PHPer();
$hirosan->name = 'hiro';
$hirosan->PHP力 = '強い';
$僕 = new PHPer();
$僕->name = 'suin';
$僕->PHP力 = '初心者くらい';
echo '<pre>';
var_dump($僕);
$hirosan->PHPを教える($僕);
var_dump($僕);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment