[Fri Mar 31 15:54:54 2017] PHP Parse error: syntax error, unexpected 'Tom' (T_STRING), expecting ',' or ';' in /home/vagrant/php_lessons/index.php on line 21
[Fri Mar 31 15:54:54 2017] 192.168.33.1:62615 [500]: / - syntax error, unexpected 'Tom' (T_STRING), expecting ',' or ';' in /home/vagrant/php_lessons/index.php on line 21
php
1<?php 2 3 4class User { 5 public $name; 6 7 public function __construct($name) { 8 $this->name = $name; 9 } 10 11 public function sayHi() { 12 echo "hi, i am $this->name!"; 13 } 14} 15class AdminUser extends User { 16 public function sayHello() { 17 echo "hello from admin!”; 18 } 19} 20 21$tom = new User("Tom"); 22$steve = new adminUser("Steve"); 23echo $steve->name; 24$steve->sayHi(); 25$steve->sayHello(); 26
よろしくお願いいたします
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2017/03/31 07:12 編集