<?php
class Math {
public int $x;
public int $y;
public function __construct($x, $y) {
$this->x = $x;
$this->y = $y;
}
public function add() {
return $this->x + $this->y;
}
}
try {
(new Math(3, "nonsense"))->add();
} catch (Error $e) {
echo "Look, I'm Python!";
}
Parse error: syntax error, unexpected 'int' (T_STRING), expecting function (T_FUNCTION) or const (T_CONST) in /in/obW7U on line 3
Process exited with code 255.