Re: [PHP-DEV] RFC Idea - is_json - looking for feedback

2022-07-31 Thread Juan Basso
($possibleJSON, FILTER_VALIDATE_JSON). Over time, if there is a need for extra parameters you can still use the filter_var flags or options (3rd parameter) to indicate if you want just JSON Object, JSON Array, JSON scalar, etc. Juan Basso On Sun, Jul 31, 2022 at 3:46 PM juan carlos morales

Re: [PHP-DEV] Optimizing php_html_entities()

2015-06-23 Thread Juan Basso
Yasuo, Did you test the performance impact on strings? Since you changed how it works the impact can be positive and maybe worth to make the method more broad. Juan Basso On Jun 23, 2015 23:01, Yasuo Ohgaki yohg...@ohgaki.net wrote: Hi Anthony, On Wed, Jun 24, 2015 at 10:40 AM, Anthony

[PHP-DEV] [RFC] Proposal - Add more cases to array_change_key_case

2015-03-26 Thread Juan Basso
#underscore-naming-strategy [8] http://api.rubyonrails.org/classes/ActiveSupport/Inflector.html Any thoughts? Thanks, Juan Basso

Re: [PHP-DEV] Serializing exceptions

2015-03-22 Thread Juan Basso
Maybe you can implement the __sleep method and just return the documented attributes (message, code, file, line). Not perfect, but probably more useful than throw an exception, specially if the exception is something that is the attribute of some object that is being serialized. Juan Basso

Re: [PHP-DEV] Arrays being generated with length and no content on master

2015-03-07 Thread Juan Basso
Great, that was quick. Tested the change with CakePHP tests and it passes now. Thank you. On Sat, Mar 7, 2015 at 3:50 AM, Xinchen Hui larue...@gmail.com wrote: Hey: On Mar 7, 2015, at 1:23 PM, Juan Basso jrba...@gmail.com wrote: I was testing CakePHP framework with PHP 7 and some tests

[PHP-DEV] Arrays being generated with length and no content on master

2015-03-06 Thread Juan Basso
=69198 I'm sending this email more to bring the attention that this can be a potential issue on the engine since other places can have the same issue or even non-internals extensions can generate this kind of weirdness. I wonder if doing this can cause some security issue. Thanks, Juan Basso

Re: [PHP-DEV] Re: Serialize generating corrupted data

2015-02-05 Thread Juan Basso
Hi, Thanks for the feedback. I opened the pull request (https://github.com/php/php-src/pull/1057). Is that correct? On Thu, Feb 5, 2015 at 12:30 PM, Stanislav Malyshev smalys...@gmail.com wrote: Hi! I can try to make a patch to solve it, but before that I would like how the behavior

[PHP-DEV] Re: Serialize generating corrupted data

2015-02-05 Thread Juan Basso
No one? On Mon, Feb 2, 2015 at 8:57 PM, Juan Basso jrba...@gmail.com wrote: Hi, I was testing few things today and I released one bug in the serialize function. The serialize function returns a corrupted value when it is serializing an object that contains a __sleep magic method

Re: [PHP-DEV] Re: Serialize generating corrupted data

2015-02-05 Thread Juan Basso
and after that it is just null without the key, causing the unserialize to not be able to parse it). If you try to unserialize it gives you the notice unserialize(): Error at offset 25 of 26 bytes in XXX. On Thu, Feb 5, 2015 at 9:57 AM, Rowan Collins rowan.coll...@gmail.com wrote: Juan Basso wrote

Re: [PHP-DEV] Re: Serialize generating corrupted data

2015-02-05 Thread Juan Basso
than a Notice, since it's clearly discarding data, but it should be consistent either way. Juan Basso wrote on 05/02/2015 15:20: Rowan, It is happening and giving the same message, but the problem is the generate value is corrupted because it generates N; without the key. Ie, when

[PHP-DEV] Serialize generating corrupted data

2015-02-02 Thread Juan Basso
a warning and return false once the input from __sleep is invalid 4) None of the above alternative 5) Don't change it Thanks, Juan Basso

Re: [PHP-DEV] Use caller keyword, to access object caller.

2015-01-29 Thread Juan Basso
Usually it is solved sending the $this instance to class C constructor and C object storing it in some attribute, solving the problem. I don't think a new keyword would help. Juan Basso On Thu, Jan 29, 2015 at 9:53 PM, S.A.N ua.san.a...@gmail.com wrote: The reason for creating circular

Re: [PHP-DEV] [VOTE] jsond

2015-01-25 Thread Juan Basso
Andrea, I did a PR to Jakub's branch with changes of preserve fractional part rfc after it was approved. His branch has the same implementation that was merged into 5.6, but adapted to master. Also, as he mentioned, the same behavior, options disabled by default. Juan Baso On Jan 25, 2015

Re: [PHP-DEV] Re: PHP7 Homework for everyone reading this list

2015-01-24 Thread Juan Basso
I see. I guess that's fine. I opened a PR for CakePHP to update the code and avoid this. Thanks. On Sat, Jan 24, 2015 at 12:47 PM, Nikita Popov nikita@gmail.com wrote: On Sat, Jan 24, 2015 at 6:40 PM, Xinchen Hui larue...@php.net wrote: Hey: On Sun, Jan 25, 2015 at 1:26 AM, Juan Basso

Re: [PHP-DEV] Re: PHP7 Homework for everyone reading this list

2015-01-24 Thread Juan Basso
I see. Shouldn't this BC break be added on the UPGRADING file too? I can open a PR if necessary. On Sat, Jan 24, 2015 at 12:40 PM, Xinchen Hui larue...@php.net wrote: Hey: On Sun, Jan 25, 2015 at 1:26 AM, Juan Basso jrba...@gmail.com wrote: I step in another failing test that I would like

Re: [PHP-DEV] Re: PHP7 Homework for everyone reading this list

2015-01-23 Thread Juan Basso
I found another segment fault on PHP 7 during CakePHP 3 tests. I reported the issue on https://bugs.php.net/bug.php?id=68896 On Fri, Jan 23, 2015 at 5:01 PM, Jan Ehrhardt php...@ehrhardt.nl wrote: Jan Ehrhardt in php.internals (Fri, 23 Jan 2015 22:18:50 +0100): Dmitry Stogov in php.internals

Re: [PHP-DEV] Re: PHP7 Homework for everyone reading this list

2015-01-23 Thread Juan Basso
This is not a segfault, but another issue exclusive from PHP 7 https://bugs.php.net/bug.php?id=68897 On Fri, Jan 23, 2015 at 11:54 PM, Juan Basso jrba...@gmail.com wrote: I found another segment fault on PHP 7 during CakePHP 3 tests. I reported the issue on https://bugs.php.net/bug.php?id

Re: [PHP-DEV] PHP7 Homework for everyone reading this list

2015-01-22 Thread Juan Basso
Trying to run phpunit on the latest CakePHP 3 gives a lot of errors of this type (not on every test case): php: /.../php-src/Zend/zend_gc.c:144: gc_possible_root: Assertion `((zend_refcounted*)(ref))-u.v.type == 7 || ((zend_refcounted*)(ref))-u.v.type == 8' failed. This errors happens after the

Re: [PHP-DEV] PHP7 Homework for everyone reading this list

2015-01-22 Thread Juan Basso
avoids the error. Should I open an issue on bugs.php.net? On Thu, Jan 22, 2015 at 11:45 PM, Juan Basso jrba...@gmail.com wrote: Trying to run phpunit on the latest CakePHP 3 gives a lot of errors of this type (not on every test case): php: /.../php-src/Zend/zend_gc.c:144: gc_possible_root

Re: [PHP-DEV] PHP7 Homework for everyone reading this list

2015-01-22 Thread Juan Basso
Yes, just tested after your change and it solved the problem. Thanks for the quick fix. On Fri, Jan 23, 2015 at 12:50 AM, Xinchen Hui larue...@php.net wrote: Hey: On Fri, Jan 23, 2015 at 1:17 PM, Juan Basso jrba...@gmail.com wrote: I could isolate the problem. Here is a script to reproduce

Re: [PHP-DEV] [RFC] [VOTE] Preserve Fractional Part in JSON encode

2015-01-19 Thread Juan Basso
Can you also resolve https://bugs.php.net/bug.php?id=50224 ? Thanks. On Jan 19, 2015 3:48 AM, Stanislav Malyshev smalys...@gmail.com wrote: Hi! Since I am not part of the core team, who can merge the PR ( https://github.com/php/php-src/pull/642)? By the way, the RFC was target to the

Re: [PHP-DEV] [RFC] [VOTE] Preserve Fractional Part in JSON encode

2015-01-18 Thread Juan Basso
, 2015 11:24 AM, Juan Basso jrba...@gmail.com wrote: The vote is now closed. By 14x0 the RFC was accepted. Since I am not part of the core team, who can merge the PR ( https://github.com/php/php-src/pull/642)? By the way, the RFC was target to the next PHP 5.6 patch version, but the PR

Re: [PHP-DEV] [RFC] [VOTE] Preserve Fractional Part in JSON encode

2015-01-17 Thread Juan Basso
? Thanks. On Sat, Jan 17, 2015 at 4:48 PM, Pascal MARTIN, AFUP mail...@pascal-martin.fr wrote: On 11/01/2015 04:02, Juan Basso wrote: I'd like to initiate a vote on this RFC: https://wiki.php.net/rfc/json_preserve_fractional_part Hi, After discussing this RFC with other people of AFUP

Re: [PHP-DEV] [RFC] Preserve Fractional Part in JSON encode

2015-01-10 Thread Juan Basso
I renamed the constant name on the RFC. Can I open the voting? On Wed, Jan 7, 2015 at 7:14 PM, Juan Basso jrba...@gmail.com wrote: I really like the new name and the consistence with the rest of php. If no one else has a complain about it I will update the RFC and open for voting, right

[PHP-DEV] [RFC] [VOTE] Preserve Fractional Part in JSON encode

2015-01-10 Thread Juan Basso
. The code was implemented and available on https://github.com/php/php-src/pull/642 Preview discussions on: - http://marc.info/?l=php-internalsm=141507087629656w=2 - http://marc.info/?l=php-internalsm=141953602116283w=2 Thanks, Juan Basso

Re: [PHP-DEV] [RFC] Preserve Fractional Part in JSON encode

2015-01-07 Thread Juan Basso
I really like the new name and the consistence with the rest of php. If no one else has a complain about it I will update the RFC and open for voting, right? Juan Basso On Jan 5, 2015 7:31 AM, Ferenc Kovacs tyr...@gmail.com wrote: On Mon, Jan 5, 2015 at 5:18 AM, Juan Basso jrba...@gmail.com

Re: [PHP-DEV] [RFC] Preserve Fractional Part in JSON encode

2015-01-04 Thread Juan Basso
Hi, Everyone has any concern on the constant name as Andrea mentioned? Should we keep or rename it? If this name is fine and there is no other concerns probably in 3 days (when completes 2 weeks) this RFC can be moved to voting, right? Thanks, Juan Basso On Thu, Dec 25, 2014 at 9:17 PM, Juan

[PHP-DEV] [RFC] Preserve Fractional Part in JSON encode

2014-12-25 Thread Juan Basso
Good evening and merry christmas, After some discussion in a separated thread I created the RFC to discuss about the implementation of another json_encode option. The RFC can be found here: https://wiki.php.net/rfc/json_preserve_fractional_part Juan Basso

Re: [PHP-DEV] [RFC] Preserve Fractional Part in JSON encode

2014-12-25 Thread Juan Basso
Exactly. The idea of this RFC is just to add as a new option and not enabled by default. The idea to enable it by default was discussed before and I just added as future scope since it is not an easy decision, especially because the backward compatibility. The main goal is to have the option to

Re: [PHP-DEV] [RFC] Preserve Fractional Part in JSON encode

2014-12-25 Thread Juan Basso
. Anyway, I am open to rename the constant to make it clear for everyone. I just can't find a better name than that. By the way, this name was proposed by Kevin Israel (plstand) on the PR. On Thu, Dec 25, 2014 at 9:01 PM, Andrea Faulds a...@ajf.me wrote: On 25 Dec 2014, at 19:32, Juan Basso jrba

Re: [PHP-DEV] Add a new flag for json_encode

2014-12-15 Thread Juan Basso
Juan Basso On Sun, Nov 30, 2014 at 11:58 PM, Juan Basso jrba...@gmail.com wrote: I see. I thought it was some sort of simplified RFC. :) Ok, I will create a RFC regarding it. On Sun, Nov 30, 2014 at 8:49 PM, Andrea Faulds a...@ajf.me wrote: On 1 Dec 2014, at 01:48, Juan Basso jrba

Re: [PHP-DEV] Add a new flag for json_encode

2014-11-30 Thread Juan Basso
What is ofc? I never heard about it before. Do I need to do something? Thanks. Juan Basso On Sat, Nov 29, 2014 at 5:45 AM, Ferenc Kovacs tyr...@gmail.com wrote: On Sat, Nov 29, 2014 at 5:39 AM, Levi Morrison le...@php.net wrote: On Fri, Nov 28, 2014 at 1:21 PM, Juan Basso jrba...@gmail.com

Re: [PHP-DEV] Add a new flag for json_encode

2014-11-30 Thread Juan Basso
I see. I thought it was some sort of simplified RFC. :) Ok, I will create a RFC regarding it. On Sun, Nov 30, 2014 at 8:49 PM, Andrea Faulds a...@ajf.me wrote: On 1 Dec 2014, at 01:48, Juan Basso jrba...@gmail.com wrote: What is ofc? I never heard about it before. Do I need to do

Re: [PHP-DEV] Add a new flag for json_encode

2014-11-28 Thread Juan Basso
Over 20 days since the last comment and seems there is a consensus about accept it to the next 5.6 patch version, right? Can it be merged? Juan Basso On Wed, Nov 5, 2014 at 9:37 PM, Juan Basso jrba...@gmail.com wrote: After the comments I see about deprecating the constant. Makes completely

Re: [PHP-DEV] Add a new flag for json_encode

2014-11-28 Thread Juan Basso
28, 2014 at 1:21 PM, Juan Basso jrba...@gmail.com wrote: Over 20 days since the last comment and seems there is a consensus about accept it to the next 5.6 patch version, right? Can it be merged? After reading over the thread, there doesn't seem to be a consensus; I am not sure how you

Re: [PHP-DEV] Add a new flag for json_encode

2014-11-05 Thread Juan Basso
proposing with this flag is to make floats values (PHP zval) output as float in the JSON. It doesn't affect anything in the PHP variables. Juan Basso

Re: [PHP-DEV] Add a new flag for json_encode

2014-11-05 Thread Juan Basso
unnecessary BC break. But if you guys wants to postpone this decision I also understand. Juan Basso

[PHP-DEV] Add a new flag for json_encode

2014-11-03 Thread Juan Basso
no impact on the other types. [1] https://github.com/php/php-src/pull/642 [2] https://bugs.php.net/bug.php?id=50224 Thanks, Juan Basso

Re: [PHP-DEV] [VOTE][RFC] Integer Semantics

2014-09-20 Thread Juan Basso
a default value for this case and worry about the other cases later. It just adds more confusion to developers to know if certain things returns 0, false, -1, etc for all different functions/operations across the language. Juan Basso

[PHP-DEV] Fix for #50224

2014-09-17 Thread Juan Basso
Hi, I came up with a solution for #50224 (https://bugs.php.net/bug.php?id=50224) on the PR https://github.com/php/php-src/pull/642 Has a lot discussion on the PR, but since July 31st there is no response. The main open discussion is in which version to apply it. Thanks, Juan Basso