3v4l.org

run code in 300+ PHP versions simultaneously
<?php $class_names = get_declared_classes(); foreach ($class_names as $class_name) { $rc = new ReflectionClass($class_name); $constructor = $rc->getConstructor(); if ($constructor != NULL) { $params = $constructor->getParameters(); echo "new $class_name("; foreach ($params as $param) { $name = $param->getName(); $opt = $param->isOptional(); if ($opt) { echo "[$name], "; } else { echo "$name, "; } } if (empty($params)) { echo "[none or dynamic]"; } echo ")\n"; } }
Output for git.master, git.master_jit
new InternalIterator([none or dynamic]) new Exception([message], [code], [previous], ) new ErrorException([message], [code], [severity], [filename], [line], [previous], ) new Error([message], [code], [previous], ) new CompileError([message], [code], [previous], ) new ParseError([message], [code], [previous], ) new TypeError([message], [code], [previous], ) new ArgumentCountError([message], [code], [previous], ) new ValueError([message], [code], [previous], ) new ArithmeticError([message], [code], [previous], ) new DivisionByZeroError([message], [code], [previous], ) new UnhandledMatchError([message], [code], [previous], ) new Closure([none or dynamic]) new ClosedGeneratorException([message], [code], [previous], ) new WeakReference([none or dynamic]) new Attribute([flags], ) new ReturnTypeWillChange([none or dynamic]) new AllowDynamicProperties([none or dynamic]) new SensitiveParameter([none or dynamic]) new SensitiveParameterValue(value, ) new Fiber(callback, ) new FiberError([none or dynamic]) new DateTime([datetime], [timezone], ) new DateTimeImmutable([datetime], [timezone], ) new DateTimeZone(timezone, ) new DateInterval(duration, ) new DatePeriod(start, [interval], [end], [options], ) new SQLite3(filename, [flags], [encryptionKey], ) new SQLite3Stmt(sqlite3, query, ) new SQLite3Result([none or dynamic]) new DOMException([message], [code], [previous], ) new DOMDocumentFragment([none or dynamic]) new DOMDocument([version], [encoding], ) new DOMAttr(name, [value], ) new DOMElement(qualifiedName, [value], [namespace], ) new DOMText([data], ) new DOMComment([data], ) new DOMCdataSection(data, ) new DOMEntityReference(name, ) new DOMProcessingInstruction(name, [value], ) new DOMXPath(document, [registerNodeNS], ) new finfo([flags], [magic_database], ) new HashContext([none or dynamic]) new JsonException([message], [code], [previous], ) new LogicException([message], [code], [previous], ) new BadFunctionCallException([message], [code], [previous], ) new BadMethodCallException([message], [code], [previous], ) new DomainException([message], [code], [previous], ) new InvalidArgumentException([message], [code], [previous], ) new LengthException([message], [code], [previous], ) new OutOfRangeException([message], [code], [previous], ) new RuntimeException([message], [code], [previous], ) new OutOfBoundsException([message], [code], [previous], ) new OverflowException([message], [code], [previous], ) new RangeException([message], [code], [previous], ) new UnderflowException([message], [code], [previous], ) new UnexpectedValueException([message], [code], [previous], ) new RecursiveIteratorIterator(iterator, [mode], [flags], ) new IteratorIterator(iterator, [class], ) new FilterIterator(iterator, ) new RecursiveFilterIterator(iterator, ) new CallbackFilterIterator(iterator, callback, ) new RecursiveCallbackFilterIterator(iterator, callback, ) new ParentIterator(iterator, ) new LimitIterator(iterator, [offset], [limit], ) new CachingIterator(iterator, [flags], ) new RecursiveCachingIterator(iterator, [flags], ) new NoRewindIterator(iterator, ) new AppendIterator([none or dynamic]) new InfiniteIterator(iterator, ) new RegexIterator(iterator, pattern, [mode], [flags], [pregFlags], ) new RecursiveRegexIterator(iterator, pattern, [mode], [flags], [pregFlags], ) new RecursiveTreeIterator(iterator, [flags], [cachingIteratorFlags], [mode], ) new ArrayObject([array], [flags], [iteratorClass], ) new ArrayIterator([array], [flags], ) new RecursiveArrayIterator([array], [flags], ) new SplFileInfo(filename, ) new DirectoryIterator(directory, ) new FilesystemIterator(directory, [flags], ) new RecursiveDirectoryIterator(directory, [flags], ) new GlobIterator(pattern, [flags], ) new SplFileObject(filename, [mode], [useIncludePath], [context], ) new SplTempFileObject([maxMemory], ) new SplFixedArray([size], ) new MultipleIterator([flags], ) new PDOException([message], [code], [previous], ) new PDO(dsn, [username], [password], [options], ) new Random\RandomError([message], [code], [previous], ) new Random\BrokenRandomEngineError([message], [code], [previous], ) new Random\RandomException([message], [code], [previous], ) new Random\Engine\Mt19937([seed], [mode], ) new Random\Engine\PcgOneseq128XslRr64([seed], ) new Random\Engine\Xoshiro256StarStar([seed], ) new Random\Randomizer([engine], ) new ReflectionException([message], [code], [previous], ) new ReflectionFunction(function, ) new ReflectionGenerator(generator, ) new ReflectionParameter(function, param, ) new ReflectionMethod(objectOrMethod, [method], ) new ReflectionClass(objectOrClass, ) new ReflectionObject(object, ) new ReflectionProperty(class, property, ) new ReflectionClassConstant(class, constant, ) new ReflectionExtension(name, ) new ReflectionZendExtension(name, ) new ReflectionReference([none or dynamic]) new ReflectionAttribute([none or dynamic]) new ReflectionEnum(objectOrClass, ) new ReflectionEnumUnitCase(class, constant, ) new ReflectionEnumBackedCase(class, constant, ) new ReflectionFiber(fiber, ) new AssertionError([message], [code], [previous], ) new SimpleXMLElement(data, [options], [dataIsURL], [namespaceOrPrefix], [isPrefix], ) new SimpleXMLIterator(data, [options], [dataIsURL], [namespaceOrPrefix], [isPrefix], ) new PharException([message], [code], [previous], ) new Phar(filename, [flags], [alias], ) new PharData(filename, [flags], [alias], [format], ) new PharFileInfo(filename, ) new PhpToken(id, text, [line], [pos], ) new Collator(locale, ) new NumberFormatter(locale, style, [pattern], ) new MessageFormatter(locale, pattern, ) new IntlDateFormatter(locale, [dateType], [timeType], [timezone], [calendar], [pattern], ) new IntlDatePatternGenerator([locale], ) new ResourceBundle(locale, bundle, [fallback], ) new Transliterator([none or dynamic]) new IntlTimeZone([none or dynamic]) new IntlCalendar([none or dynamic]) new IntlGregorianCalendar([timezoneOrYear], [localeOrMonth], [day], [hour], [minute], [second], ) new Spoofchecker([none or dynamic]) new IntlException([message], [code], [previous], ) new IntlBreakIterator([none or dynamic]) new IntlRuleBasedBreakIterator(rules, [compiled], ) new IntlCodePointBreakIterator([none or dynamic]) new UConverter([destination_encoding], [source_encoding], )
Output for rfc.literals
new InternalIterator([none or dynamic]) new Exception([message], [code], [previous], ) new ErrorException([message], [code], [severity], [filename], [line], [previous], ) new Error([message], [code], [previous], ) new CompileError([message], [code], [previous], ) new ParseError([message], [code], [previous], ) new TypeError([message], [code], [previous], ) new ArgumentCountError([message], [code], [previous], ) new ValueError([message], [code], [previous], ) new ArithmeticError([message], [code], [previous], ) new DivisionByZeroError([message], [code], [previous], ) new UnhandledMatchError([message], [code], [previous], ) new Closure([none or dynamic]) new ClosedGeneratorException([message], [code], [previous], ) new WeakReference([none or dynamic]) new Attribute([flags], ) new ReturnTypeWillChange([none or dynamic]) new Fiber(callback, ) new FiberError([none or dynamic]) new DateTime([datetime], [timezone], ) new DateTimeImmutable([datetime], [timezone], ) new DateTimeZone(timezone, ) new DateInterval(duration, ) new DatePeriod(start, [interval], [end], [options], ) new SQLite3(filename, [flags], [encryptionKey], ) new SQLite3Stmt(sqlite3, query, ) new SQLite3Result([none or dynamic]) new DOMException([message], [code], [previous], ) new DOMDocumentFragment([none or dynamic]) new DOMDocument([version], [encoding], ) new DOMAttr(name, [value], ) new DOMElement(qualifiedName, [value], [namespace], ) new DOMText([data], ) new DOMComment([data], ) new DOMCdataSection(data, ) new DOMEntityReference(name, ) new DOMProcessingInstruction(name, [value], ) new DOMXPath(document, [registerNodeNS], ) new finfo([flags], [magic_database], ) new HashContext([none or dynamic]) new JsonException([message], [code], [previous], ) new LogicException([message], [code], [previous], ) new BadFunctionCallException([message], [code], [previous], ) new BadMethodCallException([message], [code], [previous], ) new DomainException([message], [code], [previous], ) new InvalidArgumentException([message], [code], [previous], ) new LengthException([message], [code], [previous], ) new OutOfRangeException([message], [code], [previous], ) new RuntimeException([message], [code], [previous], ) new OutOfBoundsException([message], [code], [previous], ) new OverflowException([message], [code], [previous], ) new RangeException([message], [code], [previous], ) new UnderflowException([message], [code], [previous], ) new UnexpectedValueException([message], [code], [previous], ) new RecursiveIteratorIterator(iterator, [mode], [flags], ) new IteratorIterator(iterator, [class], ) new FilterIterator(iterator, ) new RecursiveFilterIterator(iterator, ) new CallbackFilterIterator(iterator, callback, ) new RecursiveCallbackFilterIterator(iterator, callback, ) new ParentIterator(iterator, ) new LimitIterator(iterator, [offset], [limit], ) new CachingIterator(iterator, [flags], ) new RecursiveCachingIterator(iterator, [flags], ) new NoRewindIterator(iterator, ) new AppendIterator([none or dynamic]) new InfiniteIterator(iterator, ) new RegexIterator(iterator, pattern, [mode], [flags], [pregFlags], ) new RecursiveRegexIterator(iterator, pattern, [mode], [flags], [pregFlags], ) new RecursiveTreeIterator(iterator, [flags], [cachingIteratorFlags], [mode], ) new ArrayObject([array], [flags], [iteratorClass], ) new ArrayIterator([array], [flags], ) new RecursiveArrayIterator([array], [flags], ) new SplFileInfo(filename, ) new DirectoryIterator(directory, ) new FilesystemIterator(directory, [flags], ) new RecursiveDirectoryIterator(directory, [flags], ) new GlobIterator(pattern, [flags], ) new SplFileObject(filename, [mode], [useIncludePath], [context], ) new SplTempFileObject([maxMemory], ) new SplFixedArray([size], ) new MultipleIterator([flags], ) new PDOException([message], [code], [previous], ) new PDO(dsn, [username], [password], [options], ) new ReflectionException([message], [code], [previous], ) new ReflectionFunction(function, ) new ReflectionGenerator(generator, ) new ReflectionParameter(function, param, ) new ReflectionMethod(objectOrMethod, [method], ) new ReflectionClass(objectOrClass, ) new ReflectionObject(object, ) new ReflectionProperty(class, property, ) new ReflectionClassConstant(class, constant, ) new ReflectionExtension(name, ) new ReflectionZendExtension(name, ) new ReflectionReference([none or dynamic]) new ReflectionAttribute([none or dynamic]) new ReflectionEnum(objectOrClass, ) new ReflectionEnumUnitCase(class, constant, ) new ReflectionEnumBackedCase(class, constant, ) new ReflectionFiber(fiber, ) new AssertionError([message], [code], [previous], ) new SimpleXMLElement(data, [options], [dataIsURL], [namespaceOrPrefix], [isPrefix], ) new SimpleXMLIterator(data, [options], [dataIsURL], [namespaceOrPrefix], [isPrefix], ) new PharException([message], [code], [previous], ) new Phar(filename, [flags], [alias], ) new PharData(filename, [flags], [alias], [format], ) new PharFileInfo(filename, ) new PhpToken(id, text, [line], [pos], ) new Collator(locale, ) new NumberFormatter(locale, style, [pattern], ) new MessageFormatter(locale, pattern, ) new IntlDateFormatter(locale, [dateType], [timeType], [timezone], [calendar], [pattern], ) new ResourceBundle(locale, bundle, [fallback], ) new Transliterator([none or dynamic]) new IntlTimeZone([none or dynamic]) new IntlCalendar([none or dynamic]) new IntlGregorianCalendar([timezoneOrYear], [localeOrMonth], [day], [hour], [minute], [second], ) new Spoofchecker([none or dynamic]) new IntlException([message], [code], [previous], ) new IntlBreakIterator([none or dynamic]) new IntlRuleBasedBreakIterator(rules, [compiled], ) new IntlCodePointBreakIterator([none or dynamic]) new UConverter([destination_encoding], [source_encoding], )

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
42.12 ms | 437 KiB | 5 Q