3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { public static $defaults = array( 'lifetime' => 0, 'path' => '/', 'domain' => '', 'secure' => false, 'httponly' => false, ); public static function initialize($options) { self::$defaults += $options; } } var_dump(A::$defaults); A::initialize(array( 'lifetime' => 120, 'secure' => true, 'httponly' => true, )); var_dump(A::$defaults);

preferences:
51 ms | 402 KiB | 5 Q