3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Language{ private $LANG = array(); /* ERROR CODE 1 DATABASE 2 EMPTY USERNAME AND PASSWORD */ function __construct() { //1 DATABASE $this->LANG[1]["TITLE"] = "DATABASE CONNECTION ERROR"; $this->LANG[1]["MESSAGE"] = "PLEASE CONTACT YOUR ADMISTRATOR"; //2 EMPTY USERNAME AND PASSWORD $this->LANG[2]["TITLE"] = "LOGIN ERROR"; $this->LANG[2]["MESSAGE"] = "INVALID USERNAME OR PASSWORD"; //3 EMPTY QUERY ERROR $this->LANG[3]["TITLE"] = "ERROR"; $this->LANG[3]["MESSAGE"] = "UNABLE TO COMMUNICATE WITH SERVER"; } function getData() { return $this->LANG; } } $l = new Language(); var_dump($l->getData());
Output for 7.1.25 - 7.1.33, 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.33, 8.2.0 - 8.2.29, 8.3.0 - 8.3.27, 8.4.1 - 8.4.14
array(3) { [1]=> array(2) { ["TITLE"]=> string(25) "DATABASE CONNECTION ERROR" ["MESSAGE"]=> string(31) "PLEASE CONTACT YOUR ADMISTRATOR" } [2]=> array(2) { ["TITLE"]=> string(11) "LOGIN ERROR" ["MESSAGE"]=> string(28) "INVALID USERNAME OR PASSWORD" } [3]=> array(2) { ["TITLE"]=> string(5) "ERROR" ["MESSAGE"]=> string(33) "UNABLE TO COMMUNICATE WITH SERVER" } }

preferences:
149.88 ms | 409 KiB | 5 Q