<?php
// Online PHP compiler: PHP 8.5, running in your browser.
// Press Run (or Ctrl/⌘ + Enter). readline() reads the Input box below.
$scores = ['Asha' => 91, 'Ravi' => 78, 'Priya' => 85];
arsort($scores);
$best = array_key_first($scores);
echo "Top scorer: $best with {$scores[$best]}\n";
echo implode(', ', array_keys($scores)), "\n";
$name = readline();
echo $name ? "Hello, $name!\n" : "Type your name in the Input box.\n";
Press ▶ Run or Ctrl/⌘ + Enter to run your code.
Runs like the php command line. There is no network or database server, and each run starts with an empty file system (SQLite in memory works).