-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Added support for foo.some_thing === foo.someThing #1299
base: 2.x
Are you sure you want to change the base?
Conversation
Wow! This seems like it might be great. I don't know enough of the C code to know how well this is implemented. That is part of the reason I haven't had a chance to follow up on #934 yet. Thanks for running with this! |
zend_property_info *pptr = (zend_property_info *) pDest; | ||
APPLY_TSRMLS_FETCH(); | ||
|
||
if (!(pptr->flags & ZEND_ACC_PUBLIC) || (pptr->flags & ZEND_ACC_STATIC)) { | ||
if ((pptr->flags & ZEND_ACC_PRIVATE) || (pptr->flags & ZEND_ACC_STATIC)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wouldn't this change cause some issues with protected
? Note that I'm not sure about my comment as I'm not a C developer
@fabpot ping This PR does not hurt performance #934 (comment) and works with properties and arrays #934 (comment) |
composer.json
Outdated
@@ -27,7 +27,8 @@ | |||
"forum": "https://groups.google.com/forum/#!forum/twig-users" | |||
}, | |||
"require": { | |||
"php": ">=5.2.4" | |||
"php": ">=5.2.4", | |||
"ext-pcre": "*" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would remove this one.
if (is_object($object)) { | ||
$class = get_class($object); | ||
if (!isset(self::$cache[$class])) { | ||
self::$cache[$class] = $this->getCacheForClass($class); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for the non-debug mode, what about keeping this cache on disk? Would that makes things faster? It looks like there is a lot going on in the getCacheForClass()
method and I cannot believe that it does not have any impacts on real-world templates.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Support for the cache may be added in another PR.
can we give this PR some life again? |
😞 |
This PR was auto-closed because I've removed the master branch and this PR was based on master. I cannot reopen it unfortunately. |
Changing the base branch to 2.x worked :) |
This one never moved forward as we did not get feedback on the C implementation. I propose to rebase it on 2.x where we don't have the C extension. |
c2a7ac3
to
d997512
Compare
@fabpot The C extension in 1.x is no longer used. Should I update this PR on 1.x or 2.x? |
@hason The C extension is gone. |
Alternative implementation of #934. Works well for methods, properties and array calls of objects with minimal performance impact. Results of twig benchmark (fabpot/twig-perf):