have situation pre-define array in way:
$packages = array( '0' => array( 'name' => 'hotel1', //pcg name 'curr' => '$', 'amount' => '125', 'period' => 'night', //pcg duration 'client_data' => array( 'name' =>'adrien', 'addr' =>'sample street', 'payment' =>'credit card', 'nights' =>'6', ) ), ); or
$packages = array(); $packages[] = array( 'name' => 'premium', //pcg name 'curr' => '$', 'amount' => '3.95', 'period' => 'month', //pcg duration 'features' => array( 'clients' =>'100', 'invoices' =>'300 <small>month</small>', 'products' =>'30', 'staff' =>'1', ) ); the data static wont fetching from
sql query or dynamic search. make difference
in terms of performance (the slightest difference helpful)
by using first or second "method" or they're 100% identical in terms of performance.
theorically "dynamic" array creation might slower because
needs check size of array, last array index and
maybe other things such those.
thank you.
one simple task takes absolutely no resources in current hardware reality. in first pc, 386dx 20mhz not make difference ;)
anyway, executed 1k times both options:
first option average:
0.000114s second option average:
0.000108s be happy!
Comments
Post a Comment