国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

Problems when calling private function test() through public function getSalary()
孫癡慢
孫癡慢 2018-10-12 06:40:47
0
4
1143

public function getSalarya()

{

$res = $this->test();

return $res;

}


## private function test(){

$res = $this->salary;

if ($this-> dept == 'Finance Department') {

? ? ? ? ? $res = 'How dare you check the people around the boss? You don't want to mess around anymore';

}

孫癡慢
孫癡慢

reply all(2)
孫癡慢

It is around 18:26 in the video. We use test() to encapsulate the filtering mechanism of the previous if statement, and then use the public getSalary() to call the private test(). I found that salary getSalary() did not return the value we needed to get. Later I found that getSalary() wants to return a value, so it needs to return the value through return in getSalary(). Return $res; is no problem. But the value passed by test() must be received through the variable $res in getSalary(). Just write $res = $this->test(); and then go back and check test(), and find that test() also needs a return to pass out $res in test(). Just add return $res; in test() and it will run. ?

  • reply The 4 pictures I added are missing. . .
    孫癡慢 author 2018-10-13 12:33:35
Peter-Zhu

Can you at least tell me what the problem is? How can I help you answer it?

  • reply Sorry, Teacher Zhu. Let me rearrange it
    孫癡慢 author 2018-10-13 09:04:33
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template