operations($a, (int)$b); return "{$a}, ${b}, " . $cstr . " = {$r}"; } #[Test('a', 'b')] private function operations(int $a, int $b): int { $this?->x?->bar(); $this->doNothing(); $c = $a + $b; $a = $c - $b; $c = $a * $b; $b = (int) ($c / $a); return $c; } } trait Baz { public function about(): array { return [ '__CLASS__' => __CLASS__, '__DIR__' => __DIR__, '__FILE__' => __FILE__, '__FUNCTION__' => __FUNCTION__, '__LINE__' => __LINE__, '__METHOD__' => __METHOD__, '__NAMESPACE__' => __NAMESPACE__, '__TRAIT__' => __TRAIT__, ]; } } class BazFoo { use Baz; } $square = fn (int $x) => $x ** 2; foreach ([-1, 0, 1, 2] as $x) { $not = match ($x) { 0 => 1, 1,-1 => 0, default => 0, }; } /* * Multi-line comment */ $foobar = new FooBar(); $baz = ['a' => 'b']; // C++ style comment $x = 3; # Perl-style comment $y = [ 1, 2, 3 ]; // Multi-line ternary statement #{Attribute] $q = ($x !== 2) ? 'yes' : 'no'; /* Heredoc */$z = $x + $y[0]; $sql = <<{x} TEMPLATE; ?> HTML

Test

about()) ?>