http://www.christophermanning.org/writing/internal-type-juggling-in-php-5-2-vs-php-5-3/
Last active
September 27, 2015 07:37
-
-
Save christophermanning/1234032 to your computer and use it in GitHub Desktop.
PHP 5.3 strlen
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -303,13 +300,14 @@ | |
Get string length */ | |
ZEND_NAMED_FUNCTION(zend_if_strlen) | |
{ | |
- zval **str; | |
+ char *s1; | |
+ int s1_len; | |
- if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &str) == FAILURE) { | |
- ZEND_WRONG_PARAM_COUNT(); | |
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &s1, &s1_len) == FAILURE) { | |
+ return; | |
} | |
- convert_to_string_ex(str); | |
- RETVAL_LONG(Z_STRLEN_PP(str)); | |
+ | |
+ RETVAL_LONG(s1_len); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment