Edit report at https://bugs.php.net/bug.php?id=35012&edit=1
ID: 35012 Updated by: ni...@php.net Reported by: flobee at gmail dot com Summary: echo, print ... reverse compiling php scripts -Status: Open +Status: Wont fix Type: Feature/Change Request -Package: Feature/Change Request +Package: *General Issues Operating System: any PHP Version: 5.1.0RC4 Block user comment: N Private report: N New Comment: This is not technically feasible. Previous Comments: ------------------------------------------------------------------------ [2005-10-29 03:03:07] flobee at gmail dot com Description: ------------ HI! i need a function which returns all echo'd var. a list which shows me used and outputed things. print_r(all echo); eg: $var = 'php'; $n = array(0=>'no',1=>'maybe',2=>'in 2005'); echo "$var is cool ".$n[2]; if($var=='pl') echo $n[1]; } // function could be named: $x = get_echoed_vars(); // $x: array('var'=>'php', 'n'=>array(2=>'in 2005') ) with this information we would be able to automate/compile php scripts (setup-scripts) dynamicly and reversible to justify script load/ressoureces in any way. or for more debug informations. (nearly like the compiler of smarty template engin, which gave me the idea: get speed without chaching or where sites cannot be cached; optimising autogenerated). programer <-> designer. problem! e.g.: when it is not clear which content really is used in a program. mostly the programmer builts an admin interface for the designer to setup a site / editing templates ... so: to give a designer max. options for a site you give him 4 varibales (in reality tonns of it) which can be included in a template. designer A take 2 vars, designer B use 4 variables for his template. so, why should be 4 variables available for designer A when he is only using 2 of it. with get_echoed_vars() i could read the needed data and rebuilt the setup-script for him (which will load the needed data). so i will have maximunm performance. :: data diagramm # default data (which will be loaded form any datacontainer (DB,txt,xml...) if(empty($designer) { $data = array( 'id'=>1, 'name'=>'title text', 'longtext'=>'long text', 'verylongtext'=>' 65555 chars'); } # programm displays all the loaded content. # designer reduce the template to display 'id' and 'title' # activating compiling mode # compiler programm calls get_echoed_vars() and rebuilts the setup setup now (data which should be loaded when program of designer A is running: $data = array( 'id'=>1, 'name'=>'title text'); actually i have this problem with 200 sites where 100% of data is available in templates and only the half of it is really displayed :-| chaching is not always the best way. king regards flo ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=35012&edit=1