eval.in

Paste #148

PHP — PHP 5.4.6, pasted 4 years ago

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
<?php

class Greeter {
  public function __construct($name) {
    $this->name = $name;
  }

  public function greet() {
    echo "Hello $this->name!\n";
  }
}

$greeter = new Greeter("Charlie");
$greeter->greet();

Program Output

Hello Charlie!

OK (0.004 sec real, 0.025 sec wall, 13 MB, 44 syscalls)

Fork