Check if a variable is set with the php function isset($var). #29

Closed
wants to merge 7 commits into
from

Projects

None yet

2 participants

@Swissbite

Because the stdClass is dynamic, a variable can be avialbe, but must not be. Insteand of just checking if aviable (by accessing it) it's much more better to aks if the variable is realy set. Why? In development mode on php, you will get thousends of warnings (ok, there are 4) that a var is not set in this content.
So the parser can easier check itself (bool-check) than type-check to null.

and others added some commits Sep 11, 2011
@sbisbee Fixing a typo bug (closes #26)
Apparently I was trying to throw a concept of a class instead of an
instantiation. Nice.
4a60747
@sbisbee Fixing HTTP/1.1 decoding for _changes. (closes #27) eb7d8e0
@sbisbee Merge branch 'master' into v0.6.x a76b203
@sbisbee CHANELOG entry for Yo-han's patch. f5fdbac
@Swissbite Swissbite Check if a variable is set with the php function isset($var).
Because the stdClass is dynamic, a variable can be avialbe, but must not be. Insteand of just checking if aviable (by accessing it) it's much more better to aks if the variable is realy set. Why? In development mode on php, you will get thousends of warnings (ok, there are 4) that a var is not set in this content.
So the parser can easier check itself (bool-check) than type-check to null.
fa47283
@Swissbite

Because of the followed notices I changed the variable and index lookup. I didn't go trough the code in every detail, just in the notices below.

Notice: Undefined variable: response in [..]/sag/src/Sag.php on line 205

Notice: Undefined index: Cookie in [..]/sag/src/Sag.php on line 941

Notice: Undefined property: stdClass::$Transfer-Encoding in [..]//sag/src/Sag.php on line 1111

Notice: Undefined property: stdClass::$Connection in [..]//sag/src/Sag.php on line 1176

Notice: Undefined variable: response in [..]/sag/src/Sag.php on line 205

Notice: Undefined index: Cookie in [..]/sag/src/Sag.php on line 941

Notice: Undefined property: stdClass::$Connection in [..]/sag/src/Sag.php on line 1176

@Swissbite Swissbite closed this Oct 8, 2011
@Swissbite Swissbite reopened this Oct 8, 2011
@Swissbite

damit, wrong button. Sorry

@sbisbee
Owner
sbisbee commented Oct 26, 2011

Hi Swissbite,

First off, thank you for your patches. It's always great to see community contribution!

I tested your changes to see if there is a performance improvement. The test suite (make check) actually ran 1 second faster without your changes. I'm sure that if I ran both code sets enough times they would average out to the same execution time.

So since Sag does not support strict mode, which is what your patches are really about, and there is no performance gain, I am not going to merge your pull request in.

However, there is plenty more work to be done on Sag. Let me know if you are interested in contributing elsewhere - help is always appreciated! :)

Cheers,
Sam

@sbisbee sbisbee closed this Oct 26, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment