perfetto funziona

ora però vediamo un po' se posso ottimizzarlo..

Codice PHP:
$idxxx = new myf;
$idxxx->myfunc();

class 
myf{

    function 
myfunc(){
        
$thearray[1][id]    = "1";
        
$thearray[1][foo]    = "primo";
        
$thearray[2][id]    = "2";
        
$thearray[2][foo]    = "secondo";
        
$thearray[3][id]    = "3";
        
$thearray[3][foo]    = "terzo"
fino a qui tutto perfetto

Codice PHP:

        $idx 
= new parsing;

        
$idx->pa($thearray);

    }

io passo la variabile "thearray" (questo perchè passo alla funzione una stringa di testo contenente "thearray" e con una regex estrapolo il singolo "thearray" (ESEMPIO: "sort thearray desc on id") e tralascio tutte le operazioni per estrarlo) quindi sarebbe

Codice PHP:
$idx->pa(thearray); 
Quindi io avrei scritto questo con il suggerimento di LeaderGL:

Codice PHP:
<?php

$idxxx 
= new myf;

$idxxx->myfunc();

class 
myf{

    function 
myfunc(){
        global 
$thearray;

        
$thearray[1][id]    = "1";
        
$thearray[1][foo]    = "primo";
        
$thearray[2][id]    = "2";
        
$thearray[2][foo]    = "secondo";
        
$thearray[3][id]    = "3";
        
$thearray[3][foo]    = "terzo";

        
$idx = new parsing;

        
$idx->pa(thearray);

    }
}

class 
parsing{

    function 
pa($parse){
        global 
$thearray;

        
$newstyle $parse;

print_r($$newstyle);

        return $
$newstyle;
    }


?>
tutto funziona che è una meraviglia

però non c'è un modo per togliere le global?? perchè se per ogni funzione in cui uso la classe parsing devo aggiungere global $thearray; diventa un po' macchinoso....