本文整理汇总了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');