3v4l.org

run code in 300+ PHP versions simultaneously
<?php echo "start skript..\n"; class CollatorExt extends Collator { public static function create() { return new self(); } } try { $collExt = CollatorExt::create('de_DE'); //object(CollatorExt) } catch (\Throwable | \Error $t) { echo "an error occured \n"; echo $t->getMessage(); }
Output for 8.1.0 - 8.1.33, 8.2.0 - 8.2.29, 8.3.0 - 8.3.25, 8.4.1 - 8.4.13
Fatal error: Declaration of CollatorExt::create() must be compatible with Collator::create(string $locale): ?Collator in /in/0fFNo on line 6
Process exited with code 255.
Output for 8.0.1 - 8.0.30
Fatal error: Declaration of CollatorExt::create() must be compatible with Collator::create(string $locale) in /in/0fFNo on line 6
Process exited with code 255.
Output for 7.4.33
start skript.. Fatal error: Uncaught Error: Class 'Collator' not found in /in/0fFNo:4 Stack trace: #0 {main} thrown in /in/0fFNo on line 4
Process exited with code 255.
Output for 7.4.0 - 7.4.32
Warning: Declaration of CollatorExt::create() should be compatible with Collator::create($arg1) in /in/0fFNo on line 6 start skript.. an error occured Collator::__construct() expects exactly 1 parameter, 0 given

preferences:
115.22 ms | 410 KiB | 5 Q