本文整理匯總了PHP中Phone::call方法的典型用法代碼示例。如果您正苦於以下問題:PHP Phone::call方法的具體用法?PHP Phone::call怎麽用?PHP Phone::call使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Phone
的用法示例。
在下文中一共展示了Phone::call方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: call
public $number;
public $RAM;
public $CPU;
public $modGSM = "TRUE";
public $OS;
public function call($abonent)
{
if ($this->modGSM) {
echo "Calling to " . $abonent . " from" . $this->number . "<br>";
}
echo "I am not able to call, please send me email.";
}
}
class Phone extends mobile
{
}
$nokia = new Phone();
$nokia->number = "+380954801117";
$nokia->call("Mike");
class Tablet extends mobile
{
public $modGSM = "FALSE";
}
$lg = new Tablet();
if ($nokia instanceof mobile) {
echo "nokia is Phone";
}
if ($nokia instanceof Tablet) {
echo "Are you sure?";
}
$lg->call(12345);
示例2: getNumberByName
<?php
/**
* Created by PhpStorm.
* User: salon02
* Date: 09.08.15
* Time: 15:00
*/
class Phone
{
public function getNumberByName($name)
{
}
protected function dialNumber()
{
}
public function call($name)
{
$number = $this->getNumberByName($name);
$this->dialNumber($number);
}
}
$phone1 = new Phone();
$phone1->call('Саша5');