How to use pts_arrays class

Best Phoronix-test-suite code snippet using pts_arrays

phodevi_linux_parser.php

Source:phodevi_linux_parser.php Github

copy

Full Screen

...21 public static function read_ipmitool_sensor($sensors, $default_value = false)22 {23 $value = $default_value;24 $ipmitool = shell_exec('ipmitool sdr list 2>&1');25 foreach(pts_arrays::to_array($sensors) as $sensor)26 {27 $hit = stripos($ipmitool, $sensor);28 if($hit !== false)29 {30 $trimmed = substr($ipmitool, ($hit + strlen($sensor)));31 $trimmed = substr($trimmed, 0, strpos($trimmed, PHP_EOL));32 $trimmed = explode('|', $trimmed);33 if(count($trimmed) == 3)34 {35 $value = explode(' ', trim($trimmed[1]));36 $value = $value[0];37 break;38 }39 }40 }41 return $value;42 }43 public static function read_ipmitool_dcmi_power()44 {45 $value = false;46 $ipmitool = shell_exec('ipmitool dcmi power reading 2>&1');47 $sensor = "Instantaneous power reading:";48 $hit = stripos($ipmitool, $sensor);49 if($hit !== false)50 {51 $trimmed = substr($ipmitool, ($hit + strlen($sensor)));52 $trimmed = substr($trimmed, 0, strpos($trimmed, PHP_EOL));53 $trimmed = trim($trimmed);54 $trimmed = explode(' ', $trimmed);55 if(count($trimmed) == 2)56 {57 $value = $trimmed[0];58 }59 }60 return $value;61 }62 public static function read_sysfs_node($search, $type = 'NUMERIC', $node_dir_check = null, $find_position = 1)63 {64 static $sysfs_file_cache = null;65 $arg_hash = crc32(serialize(func_get_args()));66 if(!isset($sysfs_file_cache[$arg_hash]))67 {68 $find_count = 0;69 foreach(pts_file_io::glob($search) as $sysfs_file)70 {71 if(is_array($node_dir_check))72 {73 $skip_to_next = false;74 $sysfs_dir = dirname($sysfs_file) . '/';75 foreach($node_dir_check as $node_check => $value_check)76 {77 if(!is_file($sysfs_dir . $node_check))78 {79 $skip_to_next = true;80 break;81 }82 else if($value_check !== true)83 {84 $value_check_value = pts_file_io::file_get_contents($sysfs_dir . $node_check);85 foreach(explode(',', $value_check) as $check)86 {87 if(isset($check[0]) && $check[0] == '!')88 {89 if($value_check_value == substr($check, 1))90 {91 $skip_to_next = true;92 break;93 }94 }95 else if($value_check_value != $check)96 {97 $skip_to_next = true;98 break;99 }100 }101 }102 if($skip_to_next)103 {104 break;105 }106 }107 if($skip_to_next)108 {109 continue;110 }111 }112 $sysfs_value = pts_file_io::file_get_contents($sysfs_file);113 switch($type)114 {115 case 'NUMERIC':116 if(is_numeric($sysfs_value))117 {118 $sysfs_file_cache[$arg_hash] = $sysfs_file;119 }120 break;121 case 'POSITIVE_NUMERIC':122 if(is_numeric($sysfs_value) && $sysfs_value > 0)123 {124 $sysfs_file_cache[$arg_hash] = $sysfs_file;125 }126 break;127 case 'NOT_EMPTY':128 if(!empty($sysfs_value))129 {130 $sysfs_file_cache[$arg_hash] = $sysfs_file;131 }132 break;133 case 'NO_CHECK':134 $sysfs_file_cache[$arg_hash] = $sysfs_file;135 break;136 }137 $find_count++;138 if($find_count < $find_position)139 {140 unset($sysfs_file_cache[$arg_hash]);141 }142 if(isset($sysfs_file_cache[$arg_hash]))143 {144 break;145 }146 }147 if(!isset($sysfs_file_cache[$arg_hash]))148 {149 $sysfs_file_cache[$arg_hash] = false;150 }151 }152 return $sysfs_file_cache[$arg_hash] == false ? -1 : pts_file_io::file_get_contents($sysfs_file_cache[$arg_hash]);153 }154 public static function read_dmidecode($type, $sub_type, $object, $find_once = false, $ignore = null)155 {156 // Read Linux dmidecode157 $value = array();158 if((phodevi::is_root() || is_readable('/dev/mem')) && pts_client::executable_in_path('dmidecode'))159 {160 $ignore = array_map('strtolower', pts_arrays::to_array($ignore));161 $dmidecode = shell_exec('dmidecode --type ' . $type . ' 2>&1');162 $sub_type = "\n" . $sub_type . "\n";163 do164 {165 $sub_type_start = strpos($dmidecode, $sub_type);166 if($sub_type_start !== false)167 {168 $dmidecode = substr($dmidecode, ($sub_type_start + strlen($sub_type)));169 $dmidecode_section = substr($dmidecode, 0, strpos($dmidecode, "\n\n"));170 $dmidecode = substr($dmidecode, strlen($dmidecode_section));171 $dmidecode_elements = explode("\n", $dmidecode_section);172 $found_in_section = false;173 for($i = 0; $i < count($dmidecode_elements) && $found_in_section == false; $i++)174 {175 $dmidecode_r = pts_strings::colon_explode($dmidecode_elements[$i]);176 if($dmidecode_r[0] == $object && isset($dmidecode_r[1]) && !in_array(strtolower($dmidecode_r[1]), $ignore))177 {178 array_push($value, $dmidecode_r[1]);179 $found_in_section = true;180 }181 }182 }183 }184 while($sub_type_start !== false && ($find_once == false || $found_in_section == false));185 }186 if(count($value) == 0)187 {188 $value = false;189 }190 else if($find_once && count($value) == 1)191 {192 $value = $value[0];193 }194 return $value;195 }196 public static function read_sys_disk_speed($path, $to_read)197 {198 $delta_mb = -1; // in MB/s199 $measure_time = 1000000; // microseconds200 if(is_file($path))201 {202 switch($to_read)203 {204 case 'WRITE':205 $sector = 6;206 break;207 case 'READ':208 $sector = 2;209 break;210 default:211 return $delta_mb;212 break;213 }214 $start_stat = pts_strings::trim_spaces(file_get_contents($path));215 usleep($measure_time);216 $end_stat = pts_strings::trim_spaces(file_get_contents($path));217 $start_stat = explode(' ', $start_stat);218 $end_stat = explode(' ', $end_stat);219 $delta_sectors = $end_stat[$sector] - $start_stat[$sector];220 // TODO check sector size instead of hardcoding it221 $delta_mb = $delta_sectors * 512 / 1048576;222 $speed = $delta_mb * 1000000 / $measure_time;223 }224 return pts_math::set_precision($speed, 2);225 }226 public static function read_sys_dmi($identifier)227 {228 $dmi = false;229 if(is_dir('/sys/class/dmi/id/'))230 {231 $ignore_words = phodevi_parser::hardware_values_to_remove();232 foreach(pts_arrays::to_array($identifier) as $id)233 {234 if(is_readable('/sys/class/dmi/id/' . $id))235 {236 $dmi_file = pts_file_io::file_get_contents('/sys/class/dmi/id/' . $id);237 if(!empty($dmi_file) && !in_array(strtolower($dmi_file), $ignore_words))238 {239 $dmi = $dmi_file;240 break;241 }242 }243 }244 }245 return $dmi;246 }247 public static function read_cpuinfo($attribute, $cpuinfo = false)248 {249 // Read CPU information250 $cpuinfo_matches = array();251 if($cpuinfo == false)252 {253 if(is_file('/proc/cpuinfo'))254 {255 $cpuinfo = file_get_contents('/proc/cpuinfo');256 }257 else258 {259 return $cpuinfo_matches;260 }261 }262 foreach(pts_arrays::to_array($attribute) as $attribute_check)263 {264 $cpuinfo_lines = explode("\n", $cpuinfo);265 foreach($cpuinfo_lines as $line)266 {267 $line = pts_strings::trim_explode(': ', $line);268 if(!isset($line[0]))269 {270 continue;271 }272 $this_attribute = $line[0];273 $this_value = (count($line) > 1 ? $line[1] : null);274 if($this_attribute == $attribute_check)275 {276 array_push($cpuinfo_matches, $this_value);277 }278 }279 if(count($cpuinfo_matches) != 0)280 {281 break;282 }283 }284 return $cpuinfo_matches;285 }286 public static function read_cpuinfo_single($attribute, $cpuinfo = false)287 {288 $cpuinfo = self::read_cpuinfo($attribute, $cpuinfo);289 if(!empty($cpuinfo))290 {291 return array_pop($cpuinfo);292 }293 return null;294 }295 public static function read_lsb_distributor_id()296 {297 $vendor = phodevi_linux_parser::read_lsb('Distributor ID');298 // Quirks for derivative distributions that don't know how to handle themselves properly299 if($vendor == 'MandrivaLinux' && phodevi_linux_parser::read_lsb('Description') == 'PCLinuxOS')300 {301 // PC Linux OS only stores its info in /etc/pclinuxos-release302 $vendor = false;303 }304 return $vendor;305 }306 public static function read_lsb($desc)307 {308 // Read LSB Release information, Linux Standards Base309 $info = false;310 if(pts_client::executable_in_path('lsb_release'))311 {312 static $output = null;313 if($output == null)314 {315 $output = shell_exec('lsb_release -a 2>&1');316 }317 if(($pos = strrpos($output, $desc . ':')) !== false)318 {319 $info = substr($output, $pos + strlen($desc) + 1);320 $info = trim(substr($info, 0, strpos($info, "\n")));321 }322 if(strtolower($info) == 'n/a')323 {324 $info = false;325 }326 }327 return $info;328 }329 public static function read_acpi($point, $match)330 {331 // Read ACPI - Advanced Configuration and Power Interface332 $value = false;333 $point = pts_arrays::to_array($point);334 for($i = 0; $i < count($point) && empty($value); $i++)335 {336 if(is_file('/proc/acpi' . $point[$i]))337 {338 $acpi_lines = explode("\n", file_get_contents('/proc/acpi' . $point[$i]));339 for($i = 0; $i < count($acpi_lines) && $value == false; $i++)340 {341 $line = pts_strings::trim_explode(': ', $acpi_lines[$i]);342 if(!isset($line[0]))343 {344 continue;345 }346 $this_attribute = $line[0];347 $this_value = (count($line) > 1 ? $line[1] : null);348 if($this_attribute == $match)349 {350 $value = $this_value;351 }352 }353 }354 }355 return $value;356 }357 public static function read_pci_subsystem_value($desc)358 {359 $lspci = shell_exec('lspci -v 2> /dev/null');360 $subsystem = null;361 foreach(pts_arrays::to_array($desc) as $check)362 {363 if(($hit = strpos($lspci, $check)) !== false)364 {365 $lspci = substr($lspci, $hit);366 if(($hit = strpos($lspci, 'Subsystem: ')) !== false)367 {368 $lspci = substr($lspci, ($hit + strlen('Subsystem: ')));369 $lspci = substr($lspci, 0, strpos($lspci, PHP_EOL));370 $vendors = array(371 'Sapphire Technology' => 'Sapphire',372 'PC Partner' => 'Sapphire',373 'Micro-Star International' => 'MSI',374 'XFX' => 'XFX',375 'ASUS' => 'ASUS',376 'Gigabyte' => 'Gigabyte',377 'Elitegroup' => 'ECS',378 'eVga' => 'eVGA',379 'Hightech Information System' => 'HIS',380 'Zotac' => 'Zotac'381 );382 foreach($vendors as $vendor => $clean_vendor)383 {384 if(stripos($lspci, $vendor) !== false)385 {386 $subsystem = $clean_vendor;387 break;388 }389 }390 }391 }392 }393 return $subsystem;394 }395 public static function read_pci($desc, $clean_string = true)396 {397 // Read PCI bus information398 static $pci_info = null;399 $info = false;400 $desc = pts_arrays::to_array($desc);401 if($pci_info == null)402 {403 if(!is_executable('/usr/bin/lspci') && is_executable('/sbin/lspci'))404 {405 $lspci_cmd = '/sbin/lspci';406 }407 else if(($lspci = pts_client::executable_in_path('lspci')))408 {409 $lspci_cmd = $lspci;410 }411 else412 {413 return false;414 }415 $pci_info = shell_exec($lspci_cmd . ' 2> /dev/null');416 }417 for($i = 0; $i < count($desc) && empty($info); $i++)418 {419 if(substr($desc[$i], -1) != ':')420 {421 $desc[$i] .= ':';422 }423 if(($pos = strpos($pci_info, $desc[$i])) !== false)424 {425 $sub_pci_info = str_replace(array('[AMD]', '[AMD/ATI]', ' Limited'), null, substr($pci_info, $pos + strlen($desc[$i])));426 $EOL = strpos($sub_pci_info, "\n");427 if($clean_string)428 {429 if(($temp = strpos($sub_pci_info, '/')) < $EOL && $temp > 0)430 {431 if(($temp = strpos($sub_pci_info, ' ', ($temp + 2))) < $EOL && $temp > 0)432 {433 $EOL = $temp;434 }435 }436 if(($temp = strpos($sub_pci_info, '(')) < $EOL && $temp > 0)437 {438 $EOL = $temp;439 }440 if(($temp = strpos($sub_pci_info, '[')) < $EOL && $temp > 0)441 {442 $EOL = $temp;443 }444 }445 $sub_pci_info = trim(substr($sub_pci_info, 0, $EOL));446 if(($strlen = strlen($sub_pci_info)) >= 6 && $strlen < 128)447 {448 $info = pts_strings::strip_string($sub_pci_info);449 }450 }451 }452 return $info;453 }454 public static function read_pci_multi($desc, $clean_string = true)455 {456 // Read PCI bus information457 static $pci_info = null;458 $info = array();459 $desc = pts_arrays::to_array($desc);460 if($pci_info == null)461 {462 if(!is_executable('/usr/bin/lspci') && is_executable('/sbin/lspci'))463 {464 $lspci_cmd = '/sbin/lspci';465 }466 else if(($lspci = pts_client::executable_in_path('lspci')))467 {468 $lspci_cmd = $lspci;469 }470 else471 {472 return false;473 }474 $pci_info = shell_exec($lspci_cmd . ' 2> /dev/null');475 }476 for($i = 0; $i < count($desc); $i++)477 {478 if(substr($desc[$i], -1) != ':')479 {480 $desc[$i] .= ':';481 }482 $pos = 0;483 while(($pos = strpos($pci_info, $desc[$i], $pos)) !== false)484 {485 $pos += strlen($desc[$i]);486 $sub_pci_info = str_replace(array('[AMD]', '[AMD/ATI]', ' Limited', ' Connection', ' Gigabit', ' Wireless', '(1)', '(2)', '(3)', '(4)', '(5)', '(6)', '(7)', '(8)', '(9)'), null, substr($pci_info, $pos));487 $EOL = strpos($sub_pci_info, "\n");488 if($clean_string)489 {490 if(($temp = strpos($sub_pci_info, '/')) < $EOL && $temp > 0)491 {492 if(($temp = strpos($sub_pci_info, ' ', ($temp + 2))) < $EOL && $temp > 0)493 {494 $EOL = $temp;495 }496 }497 if(($temp = strpos($sub_pci_info, '(')) < $EOL && $temp > 0)498 {499 $EOL = $temp;500 }501 if(($temp = strpos($sub_pci_info, '[')) < $EOL && $temp > 0)502 {503 $EOL = $temp;504 }505 }506 $sub_pci_info = trim(substr($sub_pci_info, 0, $EOL));507 if(($strlen = strlen($sub_pci_info)) >= 6 && $strlen < 128)508 {509 $info[] = pts_strings::strip_string($sub_pci_info);510 }511 }512 }513 return $info;514 }515 public static function read_sensors($attributes)516 {517 // Read LM_Sensors518 $value = false;519 if(isset(phodevi::$vfs->sensors))520 {521 $sensors = phodevi::$vfs->sensors;522 $sensors_lines = explode("\n", $sensors);523 $attributes = pts_arrays::to_array($attributes);524 for($j = 0; $j < count($attributes) && empty($value); $j++)525 {526 $attribute = $attributes[$j];527 for($i = 0; $i < count($sensors_lines) && $value == false; $i++)528 {529 $line = pts_strings::trim_explode(': ', $sensors_lines[$i]);530 if(!isset($line[0]))531 {532 continue;533 }534 $this_attribute = $line[0];535 if($this_attribute == $attribute)536 {537 $this_remainder = trim(str_replace(array('+', '°'), ' ', $line[1]));...

Full Screen

Full Screen

dump_ob_to_ae_db.php

Source:dump_ob_to_ae_db.php Github

copy

Full Screen

...73 if(!isset($system_logs['Processor'][$processor][$file]))74 {75 $system_logs['Processor'][$processor][$file] = array();76 }77 pts_arrays::popularity_tracker($system_logs['Processor'][$processor][$file], $log_file);78 }79 }80 if(($cores = $system->get_cpu_core_count()) != false && $cores > 1)81 {82 if(!isset($system_logs['Processor'][$processor]['core-count']))83 {84 $system_logs['Processor'][$processor]['core-count'] = array();85 }86 pts_arrays::popularity_tracker($system_logs['Processor'][$processor]['core-count'], $cores);87 }88 if(($threads = $system->get_cpu_thread_count()) != false && $threads > 1 && $threads > $cores)89 {90 if(!isset($system_logs['Processor'][$processor]['thread-count']))91 {92 $system_logs['Processor'][$processor]['thread-count'] = array();93 }94 pts_arrays::popularity_tracker($system_logs['Processor'][$processor]['thread-count'], $threads);95 }96 if(($v = $system->get_cpu_clock()) != false)97 {98 if(!isset($system_logs['Processor'][$processor]['cpu-clock']))99 {100 $system_logs['Processor'][$processor]['cpu-clock'] = array();101 }102 pts_arrays::popularity_tracker($system_logs['Processor'][$processor]['cpu-clock'], $v);103 }104 $system_logs['Processor'][$processor]['occurences'] = (isset($system_logs['Processor'][$processor]['occurences']) ? $system_logs['Processor'][$processor]['occurences'] : 0) + 1;105 }106 if(isset($system_data[$system->get_identifier()]['Graphics']) && !phodevi::is_fake_device($system_data[$system->get_identifier()]['Graphics']))107 {108 $graphics = $system_data[$system->get_identifier()]['Graphics'];109 if(!isset($system_logs['Graphics'][$graphics]))110 {111 $system_logs['Graphics'][$graphics] = array();112 }113 foreach(array('glxinfo', 'vulkaninfo', 'clinfo') as $file)114 {115 $log_file = $system->log_files($file);116 if($log_file && !empty($log_file))117 {118 if(!isset($system_logs['Graphics'][$graphics][$file]))119 {120 $system_logs['Graphics'][$graphics][$file] = array();121 }122 pts_arrays::popularity_tracker($system_logs['Graphics'][$graphics][$file], $log_file);123 }124 }125 $system_logs['Graphics'][$graphics]['occurences'] = (isset($system_logs['Graphics'][$graphics]['occurences']) ? $system_logs['Graphics'][$graphics]['occurences'] : 0) + 1;126 }127 if(isset($system_data[$system->get_identifier()]['Motherboard']) && !phodevi::is_fake_device($system_data[$system->get_identifier()]['Motherboard']))128 {129 $mobo = $system_data[$system->get_identifier()]['Motherboard'];130 if(!isset($system_logs['Motherboard'][$mobo]))131 {132 $system_logs['Motherboard'][$mobo] = array();133 }134 foreach(array('lspci') as $file)135 {136 $log_file = $system->log_files($file);137 if($log_file && !empty($log_file))138 {139 if(!isset($system_logs['Motherboard'][$mobo][$file]))140 {141 $system_logs['Motherboard'][$mobo][$file] = array();142 }143 pts_arrays::popularity_tracker($system_logs['Motherboard'][$mobo][$file], $log_file);144 }145 }146 $system_logs['Motherboard'][$mobo]['occurences'] = (isset($system_logs['Motherboard'][$mobo]['occurences']) ? $system_logs['Motherboard'][$mobo]['occurences'] : 0) + 1;147 }148 }149 foreach($rf->get_result_objects() as $ro)150 {151 if($ro->test_profile->get_identifier() == null)152 {153 continue;154 }155 $comparison_hash = $ro->get_comparison_hash(true, false);156 $inserts = 0;157 foreach($ro->test_result_buffer as &$buffers)158 {159 if(empty($buffers))160 continue;161 foreach($buffers as &$buffer_item)162 {163 $result = $buffer_item->get_result_value();164 if(stripos($result, ',') !== false || !is_numeric($result))165 {166 continue;167 }168 $system_identifier = $buffer_item->get_result_identifier();169 $system_layer = isset($system_data[$system_identifier]['System Layer']) ? $system_data[$system_identifier]['System Layer'] : null;170 $hw_type = $ro->test_profile->get_test_hardware_type();171 $args_desc = $ro->get_arguments_description();172 // Since some tests could stress multiple subsystems, see what the argument descriptions string says173 if(strpos($args_desc, ' GPU') || strpos($args_desc, ' CUDA') || strpos($args_desc, ' OptiX') || strpos($args_desc, ' OpenCL'))174 {175 $hw_type = 'Graphics';176 }177 else if(strpos($args_desc, ' RAM') || (strpos($args_desc, ' Memory') && strpos($args_desc, 'Hash Memory') === false ))178 {179 $hw_type = 'Memory';180 }181 else if(strpos($args_desc, ' Disk'))182 {183 $hw_type = 'Disk';184 }185 else if($hw_type == 'Network' && (strpos($args_desc, 'localhost') || strpos($args_desc, '127.0.0.1')))186 {187 // loopback / local test so network adapter really not important, moreso the system/CPU188 $hw_type = 'System';189 }190 else if($hw_type == 'Other' || $hw_type == 'OS')191 {192 continue;193 }194 switch($hw_type)195 {196 case 'Processor':197 $component = 'Processor';198 $related_component = 'OS';199 break;200 case 'System':201 $component = 'Processor';202 $related_component = 'Motherboard';203 break;204 case 'Graphics':205 $component = 'Graphics';206 $related_component = 'OpenGL';207 break;208 case 'Disk':209 $component = 'Disk';210 $related_component = 'File-System';211 break;212 case 'Network':213 $component = 'Processor';214 // TODO XXX $component = 'Network';215 $related_component = 'OS';216 break;217 case 'Memory':218 $component = 'Memory';219 $related_component = 'Processor';220 break;221 default:222 $component = 'Processor';223 $related_component = 'OS';224 break;225 }226 if(!isset($system_data[$system_identifier][$component]) || empty($system_data[$system_identifier][$component]))227 {228 continue;229 }230 $time_consumed = $buffer_item->get_run_time_total();231 $stddev = 0;232 if(($raws = $buffer_item->get_result_raw_array()) && count($raws) > 1)233 {234 $stddev_calc = pts_math::percent_standard_deviation($raws);235 if($stddev_calc > 0)236 {237 $stddev = round($stddev_calc, 2);238 }239 }240 $component_value = $system_data[$system_identifier][$component];241 $related_component_value = isset($system_data[$system_identifier][$related_component]) ? $system_data[$system_identifier][$related_component] : null;242 $ae->insert_result_into_analytic_results($comparison_hash, $result_reference, $component_value, $component, $related_component_value, $related_component, $result, $timestamps[$system_identifier], $system_types[$system_identifier], $system_layer, $time_consumed, $stddev);243 $inserts++;244 }245 }246 if($inserts > 0)247 {248 $ae->insert_composite_hash_entry_by_result_object($comparison_hash, $ro);249 }250 }251 252 }253 $ae->rebuild_composite_listing();254 foreach(array_keys($system_logs) as $category)255 {256 foreach(array_keys($system_logs[$category]) as $component)257 {258 foreach($system_logs[$category][$component] as $item => &$value)259 {260 if(is_array($value) && isset($value[0]['popularity']))261 {262 $most_popular = pts_arrays::get_most_popular_from_tracker($value);263 $system_logs[$category][$component][$item] = $most_popular;264 }265 }266 }267 }268 $ae->append_to_component_data($system_logs);269 }270}271?>...

Full Screen

Full Screen

pts_arrays

Using AI Code Generation

copy

Full Screen

1require_once('pts_arrays.php');2$pts_arrays = new pts_arrays;3$pts_arrays->add('test1');4$pts_arrays->add('test2');5$pts_arrays->add('test3');6$pts_arrays->add('test4');7$pts_arrays->add('test5');8$pts_arrays->add('test6');9$pts_arrays->add('test7');10$pts_arrays->add('test8');11$pts_arrays->add('test9');12$pts_arrays->add('test10');13$pts_arrays->add('test11');14$pts_arrays->add('test12');15$pts_arrays->add('test13');16$pts_arrays->add('test14');17$pts_arrays->add('test15');18$pts_arrays->add('test16');19$pts_arrays->add('test17');20$pts_arrays->add('test18');21$pts_arrays->add('test19');22$pts_arrays->add('test20');23$pts_arrays->add('test21');24$pts_arrays->add('test22');25$pts_arrays->add('test23');26$pts_arrays->add('test24');27$pts_arrays->add('test25');28$pts_arrays->add('test26');29$pts_arrays->add('test27');30$pts_arrays->add('test28');31$pts_arrays->add('test29');32$pts_arrays->add('test30');33$pts_arrays->add('test31');34$pts_arrays->add('test32');35$pts_arrays->add('test33');36$pts_arrays->add('test34');37$pts_arrays->add('test35');38$pts_arrays->add('test36');39$pts_arrays->add('test37');40$pts_arrays->add('test38');41$pts_arrays->add('test39');42$pts_arrays->add('test40');43$pts_arrays->add('test41');44$pts_arrays->add('test42');45$pts_arrays->add('test43');46$pts_arrays->add('test44');47$pts_arrays->add('test45');48$pts_arrays->add('test46');49$pts_arrays->add('test47');50$pts_arrays->add('test48');51$pts_arrays->add('test49');52$pts_arrays->add('test50');53$pts_arrays->add('test51');54$pts_arrays->add('test52');55$pts_arrays->add('test53');56$pts_arrays->add('test

Full Screen

Full Screen

pts_arrays

Using AI Code Generation

copy

Full Screen

1$pts_arrays = new pts_arrays();2$array1 = array("a", "b", "c", "d", "e");3$array2 = array("f", "g", "h", "i", "j");4$array3 = $pts_arrays->array_merge($array1, $array2);5print_r($array3);6$array4 = $pts_arrays->array_merge($array1, $array2, $array3);7print_r($array4);8$array5 = $pts_arrays->array_merge($array1, $array2, $array3, $array4);9print_r($array5);

Full Screen

Full Screen

pts_arrays

Using AI Code Generation

copy

Full Screen

1require_once('pts_arrays.php');2$pts_arrays = new pts_arrays();3$numbers = array(5,6,7,8,9,10);4$pts_arrays->add_number($numbers, 11);5print_r($numbers);6$pts_arrays->remove_number($numbers, 11);7print_r($numbers);8$pts_arrays->add_number($numbers, 11);9print_r($numbers);10$pts_arrays->add_number($numbers, 12);11print_r($numbers);12$pts_arrays->remove_number($numbers, 11);13print_r($numbers);14$pts_arrays->remove_number($numbers, 12);15print_r($numbers);16$pts_arrays->remove_number($numbers, 11);17print_r($numbers);

Full Screen

Full Screen

pts_arrays

Using AI Code Generation

copy

Full Screen

1$pts_arrays = new pts_arrays();2$test_names = $pts_arrays->getTestNames();3$test_results = $pts_arrays->getTestResults();4$test_name = "x264";5$test_result = $test_results[$test_name];6$test_name = "x264";7$system_name = "Intel Core i5-2520M @ 2.50GHz";8$test_result = $test_results[$test_name][$system_name];9$test_name = "x264";10$system_name = "Intel Core i5-2520M @ 2.50GHz";11$test_profile = "720p";12$test_result = $test_results[$test_name][$system_name][$test_profile];13$test_name = "x264";14$system_name = "Intel Core i5-2520M @ 2.50GHz";15$test_profile = "720p";16$test_result_name = "Encode Time";17$test_result = $test_results[$test_name][$system_name][$test_profile][$test_result_name];

Full Screen

Full Screen

pts_arrays

Using AI Code Generation

copy

Full Screen

1include_once("pts_arrays.php");2$obj=new pts_arrays();3$data=$obj->get_data("1.php");4echo "<table border=1>";5foreach($data as $row)6{7 echo "<tr>";8 foreach($row as $col)9 {10 echo "<td>".$col."</td>";11 }12 echo "</tr>";13}14echo "</table>";

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run Phoronix-test-suite automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Run Selenium Automation Tests on LambdaTest Cloud Grid

Trigger Selenium automation tests on a cloud-based Grid of 3000+ real browsers and operating systems.

Test now for Free

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful