3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test implements Countable { private $prop1, $prop2,$prop3,$prop4; public function count(){ return count(get_object_vars($this)); } $t = new Test; echo count($t);
Output for 5.4.0 - 5.4.28
Parse error: syntax error, unexpected '$t' (T_VARIABLE), expecting function (T_FUNCTION) in /in/hdbmm on line 9
Process exited with code 255.
Output for 5.3.0 - 5.3.28
Parse error: syntax error, unexpected T_VARIABLE, expecting T_FUNCTION in /in/hdbmm on line 9
Process exited with code 255.

preferences:
195.99 ms | 1395 KiB | 65 Q