3v4l.org

run code in 300+ PHP versions simultaneously
<?php class RecursiveArrayObject extends ArrayObject { public function __construct(array $array, $flags=ArrayObject::ARRAY_AS_PROPS) { foreach ($array as $key => $value) { if (is_array($value)) { $value = new self($value,$flags); } $this->_offsetSet($key, $value); } $this->setFlags($flags); } private function _offsetSet($index, $newval) { parent::offsetSet($index, $newval); } public function offsetSet($index, $newval) { var_dump($index); $this->_offsetSet($index, $newval); } public function __set($name, $value) { var_dump($name); var_dump($value); if (is_array($value)) { $value = new self($value,$flags); }else{ $this->offsetSet($name, $value); } } } $baseConfig = new RecursiveArrayObject( array( 'titulo' => 'CAWZ :: Central Admin Web Zone', 'dominio' => $_SERVER['HTTP_HOST'], 'urlActual' => $_SERVER['REQUEST_URI'], 'pagina' => basename($_SERVER['SCRIPT_NAME']), 'basePath' => dirname($_SERVER['DOCUMENT_ROOT']), 'clases' => dirname(dirname($_SERVER['DOCUMENT_ROOT'])) . '/libs', 'plantillas' => dirname($_SERVER['DOCUMENT_ROOT']) . '/plantillas/', 'traducciones' => dirname(dirname($_SERVER['DOCUMENT_ROOT'])) . '/idiomas', 'imagenes' => array( 'apartamentos' => array( 'path' => dirname($_SERVER['DOCUMENT_ROOT']) . '/www/apartamentos', 'sizes' => array('s' => '120x90', 'm' => '120x90', 'l' => '120x90'), ) ), 'idioma' => array( 'base' => 'es', 'locales' => array('es' => 'es_ES.UTF8', 'en' => 'en_US.UTF8') ), 'debug' => true ) );
Output for 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.6
Deprecated: Return type of RecursiveArrayObject::offsetSet($index, $newval) should either be compatible with ArrayObject::offsetSet(mixed $key, mixed $value): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /in/fqLRJ on line 18 Warning: Undefined array key "HTTP_HOST" in /in/fqLRJ on line 36 Warning: Undefined array key "REQUEST_URI" in /in/fqLRJ on line 37
Output for 8.0.0 - 8.0.30
Warning: Undefined array key "HTTP_HOST" in /in/fqLRJ on line 36 Warning: Undefined array key "REQUEST_URI" in /in/fqLRJ on line 37
Output for 7.4.27 - 7.4.33
Notice: Undefined index: HTTP_HOST in /in/fqLRJ on line 36 Notice: Undefined index: REQUEST_URI in /in/fqLRJ on line 37
Output for 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.40, 7.0.0 - 7.0.33, 7.1.0 - 7.1.33, 7.2.0 - 7.2.34, 7.3.0 - 7.3.33, 7.4.0 - 7.4.26
Output for 5.0.0 - 5.0.5
<br /> <b>Parse error</b>: parse error, unexpected T_ARRAY, expecting '&' or T_VARIABLE in <b>/in/fqLRJ</b> on line <b>5</b><br />
Process exited with code 255.
Output for 4.4.2 - 4.4.9
<br /> <b>Parse error</b>: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in <b>/in/fqLRJ</b> on line <b>5</b><br />
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.3.11, 4.4.0 - 4.4.1
<br /> <b>Parse error</b>: parse error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in <b>/in/fqLRJ</b> on line <b>5</b><br />
Process exited with code 255.
Output for 4.3.2 - 4.3.4
<br /> <b>Parse error</b>: parse error, expecting `T_OLD_FUNCTION' or `T_FUNCTION' or `T_VAR' or `'}'' in <b>/in/fqLRJ</b> on line <b>5</b><br />
Process exited with code 255.

preferences:
327.07 ms | 402 KiB | 468 Q