StaffCoder
PHP
PHPPHP 8
10 modules · 49 challengesSign up
Module 3 of 10 · 5 challenges

PHP Arrays

Learn how to use PHP arrays as ordered maps, transform them with array_map, array_filter and array_reduce, sort them with custom comparisons, unpack them with destructuring and variadics, and turn stock lines into an inventory summary.
Finish every challenge, or complete the star challenge, to complete the module.

Challenges

5 challenges

Stock Level Lookup

Sign up to unlock
—No data yeteasy
About this challenge

Look up and filter keyed stock levels safely when skus are missing or quantities unknown.

Solved in a browser IDE and graded by tests. Sign up to solve

Price List Transforms

Sign up to unlock
—No data yeteasy
About this challenge

Transform keyed price and item lists with array_map, array_filter and array_reduce.

Solved in a browser IDE and graded by tests. Sign up to solve

Ranked Stock Report

Sign up to unlock
—No data yeteasy
About this challenge

Sort stock lists and maps by quantity, sku and price with stable, predictable ties.

Solved in a browser IDE and graded by tests. Sign up to solve

Restock Batches

Sign up to unlock
—No data yeteasy
About this challenge

Accept any number of quantities or batches with variadic parameters and argument unpacking.

Solved in a browser IDE and graded by tests. Sign up to solve

Inventory Summary

STAR
Solving it completes the module
—No data yeteasy
About this challenge

Merge warehouse export batches into a per-product summary with totals, ranking and low-stock flags.

Solved in a browser IDE and graded by tests. Sign up to solve

We use cookies that are necessary to run Staffcoder, and optional analytics cookies to see which pages get used. Analytics stays off unless you accept. Read our Cookie Policy.