3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class JSONConverter { private function createClassInstanceFromRowSet($className, $rowSet) {         $collection = array(); foreach($rowSet as $row) { $collection[] = new $className($row); } return $collection; } public function __call($method, $args) { if (!preg_match('/^create(.+?)FromRowSet$/i', $method, $matches) { throw new \LogicException('Invalid conversion method: ' . $method); } else if (!class_exists($matches[1])) { throw new \LogicException('Invalid class name: ' . $matches[1]); } else if (!isset($args[0]) || !($args[0] instanceof Zend_Db_RowSet)) { throw new \LogicException('Invalid row set argument'); } // you could also verify that is_subclass_of($matches[1], 'CommonParent') if you want return $this->createClassInstanceFromRowSet($matches[1], $args[0]); } }
Output for 5.4.0 - 5.4.31
Parse error: syntax error, unexpected ' ' (T_STRING) in /in/VHI5r on line 7
Process exited with code 255.
Output for 5.1.0 - 5.3.28
Parse error: syntax error, unexpected T_STRING in /in/VHI5r on line 7
Process exited with code 255.
Output for 5.0.0 - 5.0.5
Parse error: parse error, unexpected T_STRING in /in/VHI5r on line 7
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/VHI5r on line 5
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/VHI5r on line 5
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/VHI5r on line 5
Process exited with code 255.