I'm trying to get values of array using POO. But I want to do it using exec (I have to).
this is my exec.php
include('PriceList.php');
for($i=0;$i<1100;$i++){
$tableau[]=$i;
}
$lstPrix = new PriceList($tableau);
exec("php execute.php ");
execute.php
include('PriceList.php');
call_user_func( 'PriceList::getLstPrix' );
and a simple class PriceList.class.php
class PriceList
{
public static $_lstPrix = array();
public function __construct($lstPrix){
self::$_lstPrix = $lstPrix;
}
public static function getLstPrix(){
return self::$_lstPrix;
}
}
I'm trying to get the values of my array but it doesn't work. Where am I doing wrong? some help pls.
execcalls a script as a seperate process. That process doesn't have access to the internal state of your current PHP script. I don't know why you would insist on usingexecbecuase it's probably not the right tool.