<?php
//firt class of eitay
class hello
{
//hello word.
public $first = 'hello world';
public function first_method()
{
$a = 1;
$b = 2;
$c = $a + $b;
return $c;
return $this->first;
}
}
$momo = new hello();
print $momo->first_method();
最佳答案
它仅打印$c
,因为该函数将在此之后返回。当您返回一个函数(在本例中为return $c
)时,它将停止执行并返回到调用函数。