3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { public string $s = null; public int $i = 1, $j = 2; } $a = new A(); echo "s" . $a->s; echo "i" . $a->i; echo "j" . $a->j;
Output for 5.5.0 - 5.5.34, 5.6.0 - 5.6.20, 7.0.0 - 7.0.5
Parse error: syntax error, unexpected 'string' (T_STRING), expecting variable (T_VARIABLE) in /in/rRRqf on line 3
Process exited with code 255.

preferences:
153.9 ms | 996 KiB | 7 Q