3v4l.org

run code in 300+ PHP versions simultaneously
<?php $c = Collator::class; $rc = new ReflectionClass($c); foreach ($rc->getMethods(ReflectionMethod::IS_PUBLIC) as $rm) { printf("- %s::%s:\n%d\n%d\n", $c, $rm->getName(), $rm->getNumberOfParameters(), $rm->getNumberOfRequiredParameters()); foreach ($rm->getParameters() as $param) { printf("Parameter #%d (%s) %s OPTIONAL\n", $param->getPosition(), $param->getName(), $param->isOptional() ? "IS" : "IS NOT"); } echo PHP_EOL; }
Output for 8.0.0 - 8.0.12, 8.0.14 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.4, 8.3.6
- Collator::__construct: 1 1 Parameter #0 (locale) IS NOT OPTIONAL - Collator::create: 1 1 Parameter #0 (locale) IS NOT OPTIONAL - Collator::compare: 2 2 Parameter #0 (string1) IS NOT OPTIONAL Parameter #1 (string2) IS NOT OPTIONAL - Collator::sort: 2 1 Parameter #0 (array) IS NOT OPTIONAL Parameter #1 (flags) IS OPTIONAL - Collator::sortWithSortKeys: 1 1 Parameter #0 (array) IS NOT OPTIONAL - Collator::asort: 2 1 Parameter #0 (array) IS NOT OPTIONAL Parameter #1 (flags) IS OPTIONAL - Collator::getAttribute: 1 1 Parameter #0 (attribute) IS NOT OPTIONAL - Collator::setAttribute: 2 2 Parameter #0 (attribute) IS NOT OPTIONAL Parameter #1 (value) IS NOT OPTIONAL - Collator::getStrength: 0 0 - Collator::setStrength: 1 1 Parameter #0 (strength) IS NOT OPTIONAL - Collator::getLocale: 1 1 Parameter #0 (type) IS NOT OPTIONAL - Collator::getErrorCode: 0 0 - Collator::getErrorMessage: 0 0 - Collator::getSortKey: 1 1 Parameter #0 (string) IS NOT OPTIONAL
Output for 8.3.5
Warning: PHP Startup: Unable to load dynamic library 'sodium.so' (tried: /usr/lib/php/8.3.5/modules/sodium.so (libsodium.so.23: cannot open shared object file: No such file or directory), /usr/lib/php/8.3.5/modules/sodium.so.so (/usr/lib/php/8.3.5/modules/sodium.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0 - Collator::__construct: 1 1 Parameter #0 (locale) IS NOT OPTIONAL - Collator::create: 1 1 Parameter #0 (locale) IS NOT OPTIONAL - Collator::compare: 2 2 Parameter #0 (string1) IS NOT OPTIONAL Parameter #1 (string2) IS NOT OPTIONAL - Collator::sort: 2 1 Parameter #0 (array) IS NOT OPTIONAL Parameter #1 (flags) IS OPTIONAL - Collator::sortWithSortKeys: 1 1 Parameter #0 (array) IS NOT OPTIONAL - Collator::asort: 2 1 Parameter #0 (array) IS NOT OPTIONAL Parameter #1 (flags) IS OPTIONAL - Collator::getAttribute: 1 1 Parameter #0 (attribute) IS NOT OPTIONAL - Collator::setAttribute: 2 2 Parameter #0 (attribute) IS NOT OPTIONAL Parameter #1 (value) IS NOT OPTIONAL - Collator::getStrength: 0 0 - Collator::setStrength: 1 1 Parameter #0 (strength) IS NOT OPTIONAL - Collator::getLocale: 1 1 Parameter #0 (type) IS NOT OPTIONAL - Collator::getErrorCode: 0 0 - Collator::getErrorMessage: 0 0 - Collator::getSortKey: 1 1 Parameter #0 (string) IS NOT OPTIONAL
Output for 8.0.13
Fatal error: Uncaught ReflectionException: Class "Collator" does not exist in /in/kpoqa:3 Stack trace: #0 /in/kpoqa(3): ReflectionClass->__construct('Collator') #1 {main} thrown in /in/kpoqa on line 3
Process exited with code 255.
Output for 7.3.32 - 7.3.33, 7.4.33
Fatal error: Uncaught ReflectionException: Class Collator does not exist in /in/kpoqa:3 Stack trace: #0 /in/kpoqa(3): ReflectionClass->__construct('Collator') #1 {main} thrown in /in/kpoqa on line 3
Process exited with code 255.
Output for 7.1.7 - 7.1.25, 7.2.0 - 7.2.33, 7.3.0 - 7.3.31, 7.4.0 - 7.4.32
- Collator::__construct: 1 1 Parameter #0 (arg1) IS NOT OPTIONAL - Collator::create: 1 1 Parameter #0 (arg1) IS NOT OPTIONAL - Collator::compare: 2 2 Parameter #0 (arg1) IS NOT OPTIONAL Parameter #1 (arg2) IS NOT OPTIONAL - Collator::sort: 2 1 Parameter #0 (arr) IS NOT OPTIONAL Parameter #1 (flags) IS OPTIONAL - Collator::sortWithSortKeys: 1 1 Parameter #0 (arr) IS NOT OPTIONAL - Collator::asort: 2 1 Parameter #0 (arr) IS NOT OPTIONAL Parameter #1 (flags) IS OPTIONAL - Collator::getAttribute: 1 1 Parameter #0 (arg1) IS NOT OPTIONAL - Collator::setAttribute: 2 2 Parameter #0 (arg1) IS NOT OPTIONAL Parameter #1 (arg2) IS NOT OPTIONAL - Collator::getStrength: 0 0 - Collator::setStrength: 1 1 Parameter #0 (arg1) IS NOT OPTIONAL - Collator::getLocale: 1 1 Parameter #0 (arg1) IS NOT OPTIONAL - Collator::getErrorCode: 0 0 - Collator::getErrorMessage: 0 0 - Collator::getSortKey: 1 1 Parameter #0 (arg1) IS NOT OPTIONAL
Output for 7.0.20, 7.1.6
- Collator::__construct: 1 1 Parameter #0 (arg1) IS NOT OPTIONAL - Collator::create: 1 1 Parameter #0 (arg1) IS NOT OPTIONAL - Collator::compare: 2 2 Parameter #0 (arg1) IS NOT OPTIONAL Parameter #1 (arg2) IS NOT OPTIONAL - Collator::sort: 2 1 Parameter #0 (arr) IS NOT OPTIONAL Parameter #1 (flags) IS OPTIONAL - Collator::sortWithSortKeys: 1 1 Parameter #0 (arr) IS NOT OPTIONAL - Collator::asort: 2 1 Parameter #0 (arr) IS NOT OPTIONAL Parameter #1 (flags) IS OPTIONAL - Collator::getAttribute: 1 1 Parameter #0 (arg1) IS NOT OPTIONAL - Collator::setAttribute: 2 2 Parameter #0 (arg1) IS NOT OPTIONAL Parameter #1 (arg2) IS NOT OPTIONAL - Collator::getStrength: 0 0 - Collator::setStrength: 1 1 Parameter #0 (arg1) IS NOT OPTIONAL - Collator::getLocale: 1 1 Parameter #0 (arg1) IS NOT OPTIONAL - Collator::getErrorCode: 0 0 - Collator::getErrorMessage: 0 0 - Collator::getSortKey: 2 2 Parameter #0 (arg1) IS NOT OPTIONAL Parameter #1 (arg2) IS NOT OPTIONAL
Output for 7.0.0 - 7.0.18, 7.1.0 - 7.1.5
- Collator::__construct: 1 1 Parameter #0 (arg1) IS NOT OPTIONAL - Collator::create: 1 1 Parameter #0 (arg1) IS NOT OPTIONAL - Collator::compare: 2 2 Parameter #0 (arg1) IS NOT OPTIONAL Parameter #1 (arg2) IS NOT OPTIONAL - Collator::sort: 2 1 Parameter #0 (arr) IS NOT OPTIONAL Parameter #1 (flags) IS OPTIONAL - Collator::sortWithSortKeys: 2 1 Parameter #0 (arr) IS NOT OPTIONAL Parameter #1 (flags) IS OPTIONAL - Collator::asort: 2 1 Parameter #0 (arr) IS NOT OPTIONAL Parameter #1 (flags) IS OPTIONAL - Collator::getAttribute: 1 1 Parameter #0 (arg1) IS NOT OPTIONAL - Collator::setAttribute: 2 2 Parameter #0 (arg1) IS NOT OPTIONAL Parameter #1 (arg2) IS NOT OPTIONAL - Collator::getStrength: 0 0 - Collator::setStrength: 1 1 Parameter #0 (arg1) IS NOT OPTIONAL - Collator::getLocale: 1 1 Parameter #0 (arg1) IS NOT OPTIONAL - Collator::getErrorCode: 0 0 - Collator::getErrorMessage: 0 0 - Collator::getSortKey: 2 2 Parameter #0 (arg1) IS NOT OPTIONAL Parameter #1 (arg2) IS NOT OPTIONAL

preferences:
176.31 ms | 403 KiB | 186 Q