Support the ongoing development of Laravel.io →
Input Views
Last updated 2 years ago.
0

Not sure I understand what you are trying to do, but in a class you could do

class myClass{

    private $var;

    public function funcA(){
        $this->var = "Test"; 
        return $this->var; 
    }
    public function funcB(){
        //$var ; 
        echo "Yeah I reused " . $this->var; 
    }

}

omaromp2 liked this reply

1
Solution selected by @omaromp2

When I try to do that it returned null. :(

Last updated 8 years ago.
0

Well I ended up reusing the var via compact. Not sure it was what I was looking for but it worked.

0

Sign in to participate in this thread!

Eventy

Your banner here too?

omaromp2 omaromp2 Joined 21 Jul 2016

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.