@ 2014-02-09T18:41:24Z <?php
class Profile_Model_Profile
{
protected $_userId;
protected $_email;
protected $_firstName;
protected $_lastName;
protected $_midName;
/**
* @var Core_Model_File
*/
protected $_cvFile;
/**
* @var Profile_Model_Affil
*/
protected $_affil;
public function __isset($key)
{
return isset($this->{'_' . self::toCamelCase($key)});
}
public function __get($key)
{
$property = '_' . self::toCamelCase($key);
if (property_exists($this, $property)) {
return $property;
}
throw new RuntimeException(sprintf('Invalid property: %s', $property));
}
public function __set($key, $value)
{
$key = self::toCamelCase($key);
$setter = 'set' . $key;
if (method_exists($this, $setter)) {
return $this->{$setter}($value);
}
$property = '_' . $key;
if (property_exists($this, $property)) {
$this->{$property} = $value;
return;
}
throw new RuntimeException(sprintf('Invalid property: %s', $property));
}
/**
* Transform given string to camel-case.
*
* @param string $str
* @return string
*/
public static function toCamelCase($str)
{
if (is_array($str) && isset($str[1])) {
return strtoupper($str[1]);
}
return preg_replace_callback(
'/_(\w)/', array(__CLASS__, __FUNCTION__), (string) $str
);
}
}
echo Profile_Model_Profile::toCamelCase('to_jest_dupa_blada_html'), "\n";
echo Profile_Model_Profile::toCamelCase('to_jest_dupa_bladaHTML');
Enable javascript to submit You have javascript disabled. You will not be able to edit any code.
Output for 5.0.0 - 5.0.5 , 5.1.0 - 5.1.6 , 5.2.0 - 5.2.17 , 5.3.0 - 5.3.29 , 5.4.0 - 5.4.45 , 5.5.24 - 5.5.35 , 5.6.7 - 5.6.28 , 7.0.0 - 7.0.20 , 7.1.0 - 7.1.33 , 7.2.0 - 7.2.33 , 7.3.0 - 7.3.33 , 7.4.0 - 7.4.33 , 8.0.0 - 8.0.30 , 8.1.0 - 8.1.27 , 8.2.0 - 8.2.17 , 8.3.0 - 8.3.4 toJestDupaBladaHtml
toJestDupaBladaHTML 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/VX4J2 on line 5
Process exited with code 255 . Output for 4.3.0 - 4.3.1 , 4.3.5 - 4.3.11 , 4.4.0 - 4.4.1 Parse error: parse error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /in/VX4J2 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/VX4J2 on line 5
Process exited with code 255 . preferences:dark mode live preview
226.57 ms | 401 KiB | 354 Q