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"; } }

preferences:
39.54 ms | 407 KiB | 5 Q