Skip to content

Instantly share code, notes, and snippets.

@monsat
Created Feb 15, 2014
Embed
What would you like to do?
Classについて、このPHPコードの実行結果が分かる程度の理解が必要です
<?php
class User {
public $name = 'user';
public $age = 20;
}
class Admin extends User {
public $name = 'admin';
}
$user = new User();
$user->age = 30;
echo $user->name;
echo $user->age;
$admin = new Admin();
echo $admin->name;
echo $admin->age;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment