3v4l.org

run code in 300+ PHP versions simultaneously
<?php $result = array_replace( array_fill_keys( array_map( function ($x) { return sprintf("%02d", $x); }, range(1, 10, 1) ), 0), ["04" => 1, "09" => 1, "10" => 1, "01" => 1]); print_r($result);
Output for 7.1.0 - 7.1.25, 7.2.0 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.29, 8.2.0 - 8.2.20, 8.3.0 - 8.3.8
Array ( [01] => 1 [02] => 0 [03] => 0 [04] => 1 [05] => 0 [06] => 0 [07] => 0 [08] => 0 [09] => 1 [10] => 1 )

preferences:
168.76 ms | 403 KiB | 176 Q