-
-
Notifications
You must be signed in to change notification settings - Fork 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
[BUG] \Phalcon\Debug Array to string conversion #1103
Comments
Could you please post the code that reproduces the bug? |
@dreamsxin <?php
ini_set('display_errors', 1);
error_reporting(-1);
(new \Phalcon\Debug)->listen();
throw new Exception('fdsfsdf'); Screenshot http://gyazo.com/b6a5c3c618b28e4cc5bda59565ed8e9d |
You are right. if (Z_TYPE_P(value) == IS_ARRAY) {
PHALCON_INIT_VAR(joined_value);
phalcon_fast_join_str(joined_value, SL(", "), value TSRMLS_CC);
PHALCON_SCONCAT_SVSVS(html, "<tr><td class=\"key\">", key_request, "</td><td>Array(", joined_value, ")</td></tr>");
} else {
PHALCON_SCONCAT_SVSVS(html, "<tr><td class=\"key\">", key_request, "</td><td>", value, "</td></tr>");
} |
@dreamsxin Please try http://host/?var[1][]=1&var[1][]=2 and see if it works |
@dreamsxin @sjinks Maybe the best way convert to json in value td if isnt string? |
When using recursion. I decided to use zend_print_zval_r output to buffer. if (Z_TYPE_P(value) == IS_ARRAY) {
PHALCON_INIT_NVAR(joined_value);
phalcon_ob_start(TSRMLS_C);
zend_print_zval_r(value, 0);
phalcon_ob_get_contents(joined_value TSRMLS_CC);
phalcon_ob_end_clean(TSRMLS_C);
PHALCON_SCONCAT_SVSVS(html, "<tr><td class=\"key\">", key_request, "</td><td>", joined_value, "</td></tr>");
} else {
PHALCON_SCONCAT_SVSVS(html, "<tr><td class=\"key\">", key_request, "</td><td>", value, "</td></tr>");
} |
maybe it would be better to use an existing method _getVarDump? |
@tema87 you are right. |
This is fixed in 1.3.0 |
make request:
/?var[]=1&var[]=2
and get the error (notice) "Array to string conversion"
The text was updated successfully, but these errors were encountered: