<?php
class Set
{
public function __construct(array $spec, $arg1 = null, $arg2 = null)
{
if (isset($spec[0]) && is_array($spec[0])) {
// was called like Set::createFromArray([['foo'=>'bar'], false, 64]);
} else {
// was called like new Set(['foo'=>'bar'], false, 64)
}
}
}
class SetFactory
{
public function create(array $map, $arg1, $arg2)
{
return new Set($map, $arg1, $arg2);
}
public function createFromArray(array $spec)
{
return new Set($spec);
}
}
<br />
<b>Parse error</b>: parse error, unexpected T_ARRAY, expecting '&' or T_VARIABLE in <b>/in/M7HYX</b> on line <b>5</b><br />
Process exited with code 255.
Output for 4.4.2 - 4.4.9
<br />
<b>Parse error</b>: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in <b>/in/M7HYX</b> on line <b>5</b><br />
Process exited with code 255.
<br />
<b>Parse error</b>: parse error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in <b>/in/M7HYX</b> on line <b>5</b><br />
Process exited with code 255.
Output for 4.3.2 - 4.3.4
<br />
<b>Parse error</b>: parse error, expecting `T_OLD_FUNCTION' or `T_FUNCTION' or `T_VAR' or `'}'' in <b>/in/M7HYX</b> on line <b>5</b><br />
Process exited with code 255.