PHP Coding Practice
Practice typing real code syntax, including brackets, punctuation, and indentation. Snippets are for typing practice only and are never executed.
Transform values with array_map
Type the code exactly. Tab inserts four spaces. Code is not executed.
Progress: 0%
Current mismatches: 0
<?php
$prices = [12, 25, 8];
$withTax = array_map(
fn (int $price): float => $price * 1.1,
$prices
);
print_r($withTax);
Type the code exactly, including spaces and indentation.