Support the ongoing development of →
Input Views
Last updated 1 year ago.

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

Solution selected by @omaromp2

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

Last updated 7 years ago.

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


Sign in to participate in this thread!


Your banner here too?

omaromp2 omaromp2 Joined 21 Jul 2016


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

Your logo here?

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

© 2024 - All rights reserved.