<?php
class Person{
var $name;
function __construct( string $name){
$this->name = $name;
}
}
class Student extends Person{
public int $age;
}
$ob = new Student("James");
echo $ob->name;
Parse error: syntax error, unexpected 'int' (T_STRING), expecting function (T_FUNCTION) or const (T_CONST) in /in/97iKq on line 11
Process exited with code 255.
Parse error: syntax error, unexpected T_STRING, expecting T_VARIABLE in /in/97iKq on line 11
Process exited with code 255.
Output for 5.1.0 - 5.1.2
Strict Standards: var: Deprecated. Please use the public/private/protected modifiers in /in/97iKq on line 4
Parse error: syntax error, unexpected T_STRING, expecting T_VARIABLE in /in/97iKq on line 11
Process exited with code 255.
Output for 5.0.0 - 5.0.5
Strict Standards: var: Deprecated. Please use the public/private/protected modifiers in /in/97iKq on line 4
Parse error: parse error, unexpected T_STRING, expecting T_VARIABLE in /in/97iKq on line 11
Process exited with code 255.
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected T_STRING, expecting ')' in /in/97iKq on line 6
Process exited with code 255.