Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

compatibility with PHP 5.2 #6

Open
matweew opened this issue Jan 31, 2012 · 5 comments
Open

compatibility with PHP 5.2 #6

matweew opened this issue Jan 31, 2012 · 5 comments
Assignees

Comments

@matweew
Copy link

matweew commented Jan 31, 2012

Parse error: syntax error, unexpected T_PAAMAYIM_NEKUDOTAYIM in ETwigViewRenderer.php on line 272
Parse error: syntax error, unexpected T_PAAMAYIM_NEKUDOTAYIM in ETwigViewRenderer.php on line 277

working code:

public function __get($property)
{
    eval('$returnedProperty = '.$this->_staticClassName.'::'.$property.';');
    return $returnedProperty;
}

public function __set($property, $value)
{
    eval('$returnedProperty = '.$this->_staticClassName.'::'.$property.';');
    return ($returnedProperty = $value);
}
@cebe
Copy link
Member

cebe commented Jan 31, 2012

hm... don't like the eval() in there, have no php 5.2 here to test things at the moment, does it work like this?

public function __get($property)
{
    $staticClass = $this->_staticClassName;
    return $staticClass::$property;
}

public function __set($property, $value)
{
    $staticClass = $this->_staticClassName;
    $staticClass::$property = $value;
}

btw: set does not have a return value:

void __set ( string $name , mixed $value )

@matweew
Copy link
Author

matweew commented Jan 31, 2012

No, syntax like this $staticClass::$property doesn't supported by php 5.2 http://stackoverflow.com/questions/592322/php-expects-t-paamayim-nekudotayim

My solution has been found here http://at-byte.com/comment/2534 .

@ghost ghost assigned cebe Jan 31, 2012
@cebe
Copy link
Member

cebe commented Jan 31, 2012

thanks, will check it.

@waitekk
Copy link

waitekk commented Apr 16, 2012

the problem is still here!

@matweew
Copy link
Author

matweew commented Apr 24, 2012

Sorry, this problem is in forked version https://github.com/Svyatov/twig-renderer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants