View difference between Paste ID: B3rxxwBL and HGjk4w2m
SHOW: | | - or go back to the newest paste.
1
<?php
2
3
class Dosen {
4-
function sum(int $a, int $b): int {
4+
    private string $name = "Kenneth";
5-
    return $a + $b;
5+
6
    public function sayHello(): string
7
    {
8-
echo sum(4, 5); // 9
8+
        return "Hello {$this->name} selamat pagi!";
9-
echo sum(4.0, 5.2); // 9 | bukan 9.2
9+
    }
10-
10+
11
12
$dosen = new Dosen();
13
echo $dosen->sayHello();