3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test { public $test1 = 1; protected $test2 = 2; private $test3 = 3; public function __construct(){} public showVariables(){ printf("public : %d\nprotected: %d\nprivate: %d", $this->test1, $this->test2, $this->test3); } } tst = new Test(); tst->showVariables();
Output for 5.4.0 - 5.4.22
Parse error: syntax error, unexpected 'showVariables' (T_STRING), expecting variable (T_VARIABLE) in /in/BKKFQ on line 10
Process exited with code 255.
Output for 5.3.0 - 5.3.27
Parse error: syntax error, unexpected T_STRING, expecting T_VARIABLE in /in/BKKFQ on line 10
Process exited with code 255.

preferences:
179.14 ms | 1386 KiB | 58 Q