28

Online PHP editor | output for p9fK2

 4 years ago
source link: https://3v4l.org/p9fK2
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Online PHP editor

@ 2020-04-16 14:33:58
<?php
final class A {
private int $value;
public function __construct(int $value)
$this->value = $value;
public function getValue(): int
return $this->value;
$a = new A(100);
echo $a->getValue() . PHP_EOL;
$a->__construct(200);
echo $a->getValue() . PHP_EOL;

Output for 7.4.0 - 7.4.9, 8.0.0alpha1 - beta1100 200 Output for 7.1.0 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.21Parse error: syntax error, unexpected 'int' (T_STRING), expecting function (T_FUNCTION) or const (T_CONST) in /in/p9fK2 on line 4
Process exited with code 255.Output for 5.4.0 - 5.4.45, 5.5.0 - 5.5.38, 5.6.0 - 5.6.40, 7.0.0 - 7.0.33Parse error: syntax error, unexpected 'int' (T_STRING), expecting variable (T_VARIABLE) in /in/p9fK2 on line 4
Process exited with code 255.Output for 5.1.0 - 5.1.6, 5.2.0 - 5.2.17, 5.3.0 - 5.3.29Parse error: syntax error, unexpected T_STRING, expecting T_VARIABLE in /in/p9fK2 on line 4
Process exited with code 255.Output for 5.0.0 - 5.0.5Parse error: parse error, unexpected T_STRING, expecting T_VARIABLE in /in/p9fK2 on line 4
Process exited with code 255.Output for 4.4.2 - 4.4.9Parse error: syntax error, unexpected T_CLASS in /in/p9fK2 on line 3
Process exited with code 255.Output for 4.3.0 - 4.3.1, 4.3.5 - 4.3.11, 4.4.0 - 4.4.1Parse error: parse error, unexpected T_CLASS in /in/p9fK2 on line 3
Process exited with code 255.Output for 4.3.2 - 4.3.4Parse error: parse error in /in/p9fK2 on line 3
Process exited with code 255.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK