3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test { public $a; public $b; public function __construct ($a) { $this->a = $a; } public function __construct ($a, $b) { $this->a = $a; $this->b = $b; } } $var = new Test (1); $var1 = new Test (1, 2); vardump ($var); vardump ($var1);
Output for 5.3.0 - 5.3.28, 5.4.0 - 5.4.24
Fatal error: Cannot redeclare Test::__construct() in /in/bgNgA on line 10
Process exited with code 255.

preferences:
199.48 ms | 1395 KiB | 61 Q