Skip to content

Instantly share code, notes, and snippets.

@cursosdesarrolloweb
Created November 28, 2020 09:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cursosdesarrolloweb/1964f5159fba55e10a68a9e3d0ff9da4 to your computer and use it in GitHub Desktop.
Save cursosdesarrolloweb/1964f5159fba55e10a68a9e3d0ff9da4 to your computer and use it in GitHub Desktop.
<?php
class User {
public function __construct(
public mixed $user,
) {}
}
$userArray = new User(["Israel", 39]);
$userClass = new User(new class { public string $name = "Israel"; public int $age = 39; });
function getUsername(): mixed {
return "cursosdesarrolloweb";
}
echo getUsername();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment