kamil-tekiela
Repos
29
Followers
16
Following
1

Bot to automatically flag unnecessary comments on Stack Overflow after a year

0
0

Events

issue comment
Major overhaul of mbstring (part 26)

It says UTF-8

Created at 3 days ago
issue comment
Major overhaul of mbstring (part 26)

I only did a simple loop for ($i = 42; $i < 0x10FFFF; $i++) { and executed mb_strtoupper(mb_chr($i)); inside it. I then compared output on PHP 8.0 and with your patch. That's it. :)

Created at 3 days ago
issue comment
Major overhaul of mbstring (part 26)

Hi Alex,

I am doing some light testing and I cannot figure out why I get different outputs for mb_strtoupper() with your PR. I computed a diff of the codepoints, but I don't think these codepoints are valid Unicode characters, so I am a little confused why I got a mismatch. Is this something that your implementation changed?

array(40) {
  [0] =>
  array(2) {
    [0] =>
    int(11359)
    [2] =>
    int(11311)
  }
  [1] =>
  array(2) {
    [0] =>
    int(42945)
    [2] =>
    int(42944)
  }
  [2] =>
  array(2) {
    [0] =>
    int(42961)
    [2] =>
    int(42960)
  }
  [3] =>
  array(2) {
    [0] =>
    int(42967)
    [2] =>
    int(42966)
  }
  [4] =>
  array(2) {
    [0] =>
    int(42969)
    [2] =>
    int(42968)
  }
  [5] =>
  array(2) {
    [0] =>
    int(66967)
    [2] =>
    int(66928)
  }
  [6] =>
  array(2) {
    [0] =>
    int(66968)
    [2] =>
    int(66929)
  }
  [7] =>
  array(2) {
    [0] =>
    int(66969)
    [2] =>
    int(66930)
  }
  [8] =>
  array(2) {
    [0] =>
    int(66970)
    [2] =>
    int(66931)
  }
  [9] =>
  array(2) {
    [0] =>
    int(66971)
    [2] =>
    int(66932)
  }
  [10] =>
  array(2) {
    [0] =>
    int(66972)
    [2] =>
    int(66933)
  }
  [11] =>
  array(2) {
    [0] =>
    int(66973)
    [2] =>
    int(66934)
  }
  [12] =>
  array(2) {
    [0] =>
    int(66974)
    [2] =>
    int(66935)
  }
  [13] =>
  array(2) {
    [0] =>
    int(66975)
    [2] =>
    int(66936)
  }
  [14] =>
  array(2) {
    [0] =>
    int(66976)
    [2] =>
    int(66937)
  }
  [15] =>
  array(2) {
    [0] =>
    int(66977)
    [2] =>
    int(66938)
  }
  [16] =>
  array(2) {
    [0] =>
    int(66979)
    [2] =>
    int(66940)
  }
  [17] =>
  array(2) {
    [0] =>
    int(66980)
    [2] =>
    int(66941)
  }
  [18] =>
  array(2) {
    [0] =>
    int(66981)
    [2] =>
    int(66942)
  }
  [19] =>
  array(2) {
    [0] =>
    int(66982)
    [2] =>
    int(66943)
  }
  [20] =>
  array(2) {
    [0] =>
    int(66983)
    [2] =>
    int(66944)
  }
  [21] =>
  array(2) {
    [0] =>
    int(66984)
    [2] =>
    int(66945)
  }
  [22] =>
  array(2) {
    [0] =>
    int(66985)
    [2] =>
    int(66946)
  }
  [23] =>
  array(2) {
    [0] =>
    int(66986)
    [2] =>
    int(66947)
  }
  [24] =>
  array(2) {
    [0] =>
    int(66987)
    [2] =>
    int(66948)
  }
  [25] =>
  array(2) {
    [0] =>
    int(66988)
    [2] =>
    int(66949)
  }
  [26] =>
  array(2) {
    [0] =>
    int(66989)
    [2] =>
    int(66950)
  }
  [27] =>
  array(2) {
    [0] =>
    int(66990)
    [2] =>
    int(66951)
  }
  [28] =>
  array(2) {
    [0] =>
    int(66991)
    [2] =>
    int(66952)
  }
  [29] =>
  array(2) {
    [0] =>
    int(66992)
    [2] =>
    int(66953)
  }
  [30] =>
  array(2) {
    [0] =>
    int(66993)
    [2] =>
    int(66954)
  }
  [31] =>
  array(2) {
    [0] =>
    int(66995)
    [2] =>
    int(66956)
  }
  [32] =>
  array(2) {
    [0] =>
    int(66996)
    [2] =>
    int(66957)
  }
  [33] =>
  array(2) {
    [0] =>
    int(66997)
    [2] =>
    int(66958)
  }
  [34] =>
  array(2) {
    [0] =>
    int(66998)
    [2] =>
    int(66959)
  }
  [35] =>
  array(2) {
    [0] =>
    int(66999)
    [2] =>
    int(66960)
  }
  [36] =>
  array(2) {
    [0] =>
    int(67000)
    [2] =>
    int(66961)
  }
  [37] =>
  array(2) {
    [0] =>
    int(67001)
    [2] =>
    int(66962)
  }
  [38] =>
  array(2) {
    [0] =>
    int(67003)
    [2] =>
    int(66964)
  }
  [39] =>
  array(2) {
    [0] =>
    int(67004)
    [2] =>
    int(66965)
  }
}
Created at 3 days ago
push

Reword explanation of rowCount (#1843)

Created at 3 days ago
pull request closed
Improve rowCount explanation

This puts emphasis on the important part. Some have claimed that rowCount will return inconsistent, untrue or broken results. That's not true.

Created at 3 days ago
pull request opened
Improve rowCount explanation

This puts emphasis on the important part. Some have claimed that rowCount will return inconsistent, untrue or broken results. That's not true.

Created at 3 days ago
create branch
kamil-tekiela create branch rowCount-explanation
Created at 3 days ago
issue comment
Add "die()" as an option to exit a function with return typ "never"

That's unnecessary. If you really insist then something like exit/die would look better, but since it's the exact same language construct, I don't think it's needed at all.

Created at 3 days ago
push

Remove confusing and irrelevant sentence

Created at 3 days ago

Add mb_str_split to see also in str_split

Closes GH-1309

Default value for error_reporting is E_ALL as of PHP 8.0.0 (#1307)

Properties do not need to be declared with a visibility modifier (#1311)

Co-authored-by: Christoph M. Becker cmbecker69@gmx.de

added readonly modifier link.

fixed property example which is outside a class.

Fix GH-1314: getAvailableDrivers shows as pdo_drivers and not clickable

This method no longer returns false

It already has a changelog entry

Document mysqli_sql_exception::getSqlState() (#1310)

Co-authored-by: Kamil Tekiela tekiela246@gmail.com

Refer to preg_replace() docs for param docs of preg_filter() (#723)

DomDocument::createTextNode() doesn't return false anymore

Changelog entry already exists

Fix datatype in SQLite3 example

SQLite3 does not have a 'STRING' data type. Cf. https://www.sqlite.org/datatype3.html.

Closes GH-1320.

[PHP 8.0] Add new DOM interfaces (#1025)

Co-authored-by: Christoph M. Becker cmbecker69@gmx.de

Fix DOMParentNode and DOMChildNode class and method synopses (#1321)

Update defaults of session.cookie_secure and .cookie_httponly

That's rather a cosmetic change, but we still should strive to be precise.

Fix GH-1318: get_resources has access to object-controlled resources

Document options for gnupg_init (#1322)

Fix typo in gnupg_init example (#1325)

Clarification for setting 0 to jit_hot_loop/func

I tried to tell JIT to compile every loops and functions by setting both opcache.jit_hot_loop and opcache.jit_hot_functions to 0, but failed to get expected result.

After having read the source code and simple experiments, I found that setting these two options to 0 will actually disable JIT to compile any iterations and calls.

So I would like to add clarifications for this behavior in PHP manual.

Signed-off-by: Su, Tao tao.su@intel.com

Closes GH-1324.

Clarify meaning of opcache.optimization_level

[PHP 8.1] Calling a static element on a trait is deprecated (#1330)

Created at 3 days ago
push

Removing try-catch from examples (#1765)

Using try catch is irrelevant to examples and echoing errors out unconditionally is a bad practice.

Created at 3 days ago
pull request closed
Removing try-catch from examples

Using try catch is irrelevant to examples and echoing errors out unconditionally is a bad practice.

Created at 3 days ago
issue comment
Update footer.inc

We could have an else condition too. It would link to doc-en.

Created at 5 days ago
issue comment
Update footer.inc

Thanks. The code makes more sense now, but still isn't something that we would merge. However, I think cmb69 might be right that the solution you are proposing isn't the ideal solution.

Created at 5 days ago
issue comment
Update footer.inc

Well, then someone must be wrong; either you or me. @cmb69 Can you see a ternary operator in the code? Perhaps, you saw the : starting the if block and you confused it with a ternary operator... but that still would not explain the flaw in logic.

Created at 6 days ago
issue comment
Update footer.inc

Do you mean you inserted a ternary operator there somewhere? I cannot see it in this PR.

Created at 6 days ago
issue comment
Update footer.inc

Did you by any chance mean to use && instead of ||. I think that would make more sense.

Created at 6 days ago
issue comment
Fix for handle large number of tables in a single database (based on QA_5_2)

Thanks for the script. I have reviewed it and I can't really find anything wrong with this PR. However, the description is a little misleading because it doesn't fix the issue that you linked to. It does fix at least 2 other bugs from what I observed. It also improves performance for databases with a lot of tables.

Now, with that many tables, phpMyAdmin chokes up in a lot of areas. Perhaps, it would be a good idea to do more benchmarking and try to improve performance elsewhere too. That's some idea for future PRs. :)

As for what this actually fixed, it seems to have fixed two issues. First, passing an integer to array_map. I understand why it was done, but it was definitely wrong and in PHP 8 would result in a hard error. Surprisingly, it didn't come up in tests or in real life. PHPStan caught it (this PR could also adjust the baseline). I think a proper fix is in order but that's a small priority. Secondly, this fixes an issue with natural sorting. MySQL ordered the results by name using lexical sort and then the limited results would be sorted using natural sort in PHP. It's certainly not how it was intended to work. It definitely caught me by surprise while testing this PR. Big thanks for fixing this bug. Still, if the table list is not sorted by name, the sorting might be off. However, a similar sorting problem can be observed in other places, mainly in navigation. There the items are still ordered by MySQL. While before this change, the sorting was the same in navigation and in the table list, now it's different. Probably another PR should be created to address sorting issues in other places.

As for this PR, I think it can be merged. Please adjust PHPStan baseline and add DCO to the commits (you can merge them all into one).

Created at 6 days ago
issue comment
Export query result ignores query LIMIT

This is done on purpose. I don't what the initial thought behind this was, but I think this behaviour should be changed now.

I think that this behaviour was introduced because the export functionality has its own limiting functionality. By default "quick" option is selected which means that it dumps all rows. If you'd like to limit the number of rows, you need to select "Custom" and enter the number of rows. Possibly, a new feature could be that the LIMIT clause is automatically converted into a default value for "Dump some rows" and the "Custom" option is preselected.

Created at 6 days ago
issue comment
"No privileges to create databases" message not showing on master

I cannot reproduce this. I created a user with no privileges and I can see the message on both servers.

Created at 6 days ago
issue comment
"No privileges to create databases" message not showing on master

Can you share the user that you used? Which privileges does it have?

Created at 6 days ago
issue comment
Remove security section

@cmb69 Is it safe to merge this too?

Created at 1 week ago

Announce SymfonyCon Disneyland Paris 2022 conference

Closes GH-596.

Announce SymfonyWorld Online 2022 Winter Edition conference

Closes GH-597.

Remove useless function manual_header()

Closes GH-584.

phpversion() replacements and code branch collapsing for older PHP versions

Closes GH-600.

Multiple micro-optimizations

  • Replace ob_get_contents();ob_clean() with ob_get_clean()

ob_get_clean() is equivalent to ob_get_contents() followed by ob_clean().

  • Replace intval() calls with (int) type cast

This is a micro-optimization because intval() is a function call, and the type cast is about 6 times fast.

  • Replace preg_replace call that could be done with an rtrim() call

In ./error.php, there is a preg_replace('!/+$!', '', $URI); call that essentially is equivalent to rtrim(), that both calls removing trailing slash characters in $URI. The rtim() call is more legible and faster.

  • Combine consecutive str_replace calls to a single str_replace call

  • Use short ternary operator where possible

Improves code readability.

  • Cascade various else statements where possible

Cleans up the code by removing unnecessary else blocks and moving the code to the parent context if the previous if block exits the function by either terminating the script, or with a return statement.

  • Combine multiple isset() calls to a single isset()

isset() accepts multiple parameters and returns true only if all of the parameters are isset. It makes sense to combine multiple individual isset calls to a single call for better readability.

  • Replace for loop with a foreach loop

  • Remove unnecessary character escapes in regular expressions

Regular expression special characters are context-sensitive. For example, special characters such as . are not considered special within square braces ([]). This removes several of such instances that certain characters are escaped, but it is not strictly necessary within the context. This improves the readability of the expression.

See more information at PHP.Watch: Writing better Regular Expressions in PHP

  • Remove unnecessary break statement

  • Remove unnecessary PHP close tags

  • Remove redundant JSON_ERROR_NONE check

Remove unnecessary json_last_error() == JSON_ERROR_NONE where the decoded object is inspected already.

Closes GH-603.

Micro Optimizations - Round #2

  • .gitignore: Remove redundant entry

  • Minor optimizations with ternary operators

  • Use const instead of define() where appropriate

const is quite faster because of the compile-time optimizations. Because the replaced statements are not declaring constant conditionally, it's safe to use const in all of these places.

Closes GH-608.

HTML A11y improvements in add-note.php, my.php and vote-note.php

Also use strict comparison in pages that are changed.

Closes GH-610.

Postponement PHP Russia 2022 to November (#611)

Minor optimizations in CSS files to shed some weight (#612)

  • Removes px suffix from 0px.
  • Combines CSS properties where they are immediately overridden in the same selector block, or can be combined without side effects.

This saves about 50 bytes off the CSS scripts. it ain't much but it's honest work

Test UserNotes\Sorter

We add a copy of the latest run-tests.php from the PHP-8.0 branch, and tests for the UserNotes\Sorter with full code coverage. We also run tests on GitHub Actions.

Co-authored-by: Andreas Möller am@localheinz.com

Closes GH-606.

Enhancement: Use PSR-4 autoloader (#604)

Update PHP version requirement

Closes GH-609.

Enhancement: Add badge to README.md

Closes GH-613.

Remove parentheses around include (#546)

Combine consecutive unsets (#543)

Remove id prefix (#618)

Update distributions

Announcing International PHP Conference Munich 2022

Co-authored-by: cbrueckner cbrueckner@sandsmedia.com Co-authored-by: Amir Jelodar ajelodar@sandsmedia.com

Closes GH-617.

Announce PHP 8.0.21

Announce PHP 8.2.0alpha3

Created at 1 week ago

Remove url.crypt.blowfish entity (#66)

Created at 1 week ago
pull request closed
Remove url.crypt.blowfish entity

See https://github.com/php/doc-en/pull/1667 and https://github.com/php/web-php/pull/595

Created at 1 week ago
issue comment
Remove url.crypt.blowfish entity

Or just break these builds?

I would be ok with that. As far as I know, it doesn't break the site, it just breaks new builds, correct?

Created at 1 week ago