3v4l.org

run code in 300+ PHP versions simultaneously
<?php function depbuild($name, $location, $suffix, $locale) { var_dump(array( implode('-', array_filter(array($name, $location, $suffix, $locale))), $name, )); } $name = 'foo'; $location = array(null, 'GL', 'AS'); $suffix = array(null, 'P','C'); $locale = array(null, 'fr_FR'); foreach($location as $loc) { foreach($suffix as $s) { foreach($locale as $l) { depbuild($name, $loc, $s, $l); } } }
Output for 4.3.0 - 4.3.11, 4.4.0 - 4.4.9, 5.0.0 - 5.0.5, 5.1.0 - 5.1.6, 5.2.0 - 5.2.17, 5.3.0 - 5.3.29, 5.4.0 - 5.4.45, 5.5.0 - 5.5.38, 5.6.0 - 5.6.28, 7.0.0 - 7.0.20, 7.1.0 - 7.1.20, 7.2.0 - 7.2.33, 7.3.12 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.6
array(2) { [0]=> string(3) "foo" [1]=> string(3) "foo" } array(2) { [0]=> string(9) "foo-fr_FR" [1]=> string(3) "foo" } array(2) { [0]=> string(5) "foo-P" [1]=> string(3) "foo" } array(2) { [0]=> string(11) "foo-P-fr_FR" [1]=> string(3) "foo" } array(2) { [0]=> string(5) "foo-C" [1]=> string(3) "foo" } array(2) { [0]=> string(11) "foo-C-fr_FR" [1]=> string(3) "foo" } array(2) { [0]=> string(6) "foo-GL" [1]=> string(3) "foo" } array(2) { [0]=> string(12) "foo-GL-fr_FR" [1]=> string(3) "foo" } array(2) { [0]=> string(8) "foo-GL-P" [1]=> string(3) "foo" } array(2) { [0]=> string(14) "foo-GL-P-fr_FR" [1]=> string(3) "foo" } array(2) { [0]=> string(8) "foo-GL-C" [1]=> string(3) "foo" } array(2) { [0]=> string(14) "foo-GL-C-fr_FR" [1]=> string(3) "foo" } array(2) { [0]=> string(6) "foo-AS" [1]=> string(3) "foo" } array(2) { [0]=> string(12) "foo-AS-fr_FR" [1]=> string(3) "foo" } array(2) { [0]=> string(8) "foo-AS-P" [1]=> string(3) "foo" } array(2) { [0]=> string(14) "foo-AS-P-fr_FR" [1]=> string(3) "foo" } array(2) { [0]=> string(8) "foo-AS-C" [1]=> string(3) "foo" } array(2) { [0]=> string(14) "foo-AS-C-fr_FR" [1]=> string(3) "foo" }

preferences:
276.32 ms | 412 KiB | 357 Q