Loading workspace environment...
Get started with PHP syntax, structure, and writing your first program.
<?php
// PHP 8.3 Syntax & Learning Sandbox
function greetUser(string $name, string $role = 'Developer'): string {
return "Hello, $name! Role: $role";
}
$users = ['Ada Lovelace', 'Alan Turing', 'Linus Torvalds'];
foreach ($users as $user) {
echo greetUser($user) . "\n";
}