3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $codes = []; $codes[] = "^BT"; $codes[] = "^GY"; $codes[] = "^HS"; $codes[] = "^IM"; for ($i = 41; $i <= 49; $i++) { $codes[] = "^IV{$i}"; } $codes[] = "^IV51"; $codes[] = "^IV55"; $codes[] = "^IV56"; $codes[] = "^KA27"; $codes[] = "^KA28"; $codes[] = "^KW15"; $codes[] = "^KW16"; $codes[] = "^KW17"; $codes[] = "^PA20"; for ($i = 41; $i <= 49; $i++) { $codes[] = "^PA{$i}"; } for ($i = 60; $i <= 69; $i++) { $codes[] = "^PA{$i}"; } for ($i = 70; $i <= 78; $i++) { $codes[] = "^PA{$i}"; } for ($i = 30; $i <= 41; $i++) { $codes[] = "^PO{$i}"; } for ($i = 42; $i <= 44; $i++) { $codes[] = "^PH{$i}"; } $codes[] = "^TDCU"; $codes[] = "^ZE"; echo json_encode(["post_code" => $codes]);
based on vNKQc
Output for 5.6.30, hhvm-3.18.5 - 3.22.0, 7.0.30 - 7.3.0beta1
{"post_code":["^BT","^GY","^HS","^IM","^IV41","^IV42","^IV43","^IV44","^IV45","^IV46","^IV47","^IV48","^IV49","^IV51","^IV55","^IV56","^KA27","^KA28","^KW15","^KW16","^KW17","^PA20","^PA41","^PA42","^PA43","^PA44","^PA45","^PA46","^PA47","^PA48","^PA49","^PA60","^PA61","^PA62","^PA63","^PA64","^PA65","^PA66","^PA67","^PA68","^PA69","^PA70","^PA71","^PA72","^PA73","^PA74","^PA75","^PA76","^PA77","^PA78","^PO30","^PO31","^PO32","^PO33","^PO34","^PO35","^PO36","^PO37","^PO38","^PO39","^PO40","^PO41","^PH42","^PH43","^PH44","^TDCU","^ZE"]}