3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class A{ protected $a1; protected $a2; protected $a3; protected $a4; protected $a5; protected $a6; protected $a7; protected $a8; protected $a9; protected $a10; public function __construct(array $data){ foreach ($data as $k => $v) { $this->$k = $v; } } } $iter = 10000; for ($i=0; $i<$iter; $i++) { $a = new A(array( 'a1' => 'hello', 'a2' => 'hello', 'a3' => 'hello', 'a4' => 'hello', 'a5' => 'hello', 'a6' => 'hello', 'a7' => 'hello', 'a8' => 'hello', 'a9' => 'hello', 'a10' => 'hello' )); }
Output for 5.1.0 - 7.1.0
Output for 5.0.0 - 5.0.5
Parse error: parse error, unexpected T_ARRAY, expecting '&' or T_VARIABLE in /in/SsL1i on line 14
Process exited with code 255.
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /in/SsL1i on line 3
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1
Parse error: parse error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /in/SsL1i on line 3
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error, expecting `T_OLD_FUNCTION' or `T_FUNCTION' or `T_VAR' or `'}'' in /in/SsL1i on line 3
Process exited with code 255.