<?php
class SomeClass {
public function do_string(){
$this->cacheFile();
$unimportant_code = "unimportant";
$someClass = new SomeClass();
$some_string = $someClass->string; //Retruns 4
$some_string = $some_string + 2;
$variable = $some_string; //6
$this->pass($variable);
}
public function pass($var){
//Do something with var and get the code I need
$variable = $var;
require_once("template.php"); //In this file there's a code block
//{NOCACHE}
//Do something with $variable;
//{/NOCACHE}
}
public function cacheFile(){
//If file exists cache file
//If found {NOCACHE} {/NOCACHE} execute the code needed to change the $variable between {NOCACHE}{/NOCACHE}
}
}
?>
I want to get the exact coded affecting the value of $variable from the do_string() method that would be.
$someClass = new SomeClass()
$some_string = $someClass->string //Retruns 4
$some_string = $some_string + 2;
$variable = $some_string; //6
So that later I can execute it if needed, I'm trying to make a cache system. Is there anything like debug_backtrace() but for a $variable?