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 function showVariables(){ printf("public : %d\nprotected: %d\nprivate: %d", $this->test1, $this->test2, $this->test3); } } tst = new Test; tst->showVariables();
Output for 5.3.0 - 5.3.27, 5.4.0 - 5.4.22
Parse error: syntax error, unexpected '=' in /in/O8irU on line 15
Process exited with code 255.

preferences:
184.33 ms | 1395 KiB | 58 Q