php

php

PHP is a popular general-purpose scripting language that is especially suited to web development

Member Since 12 years ago

Experience Points
0
follower
Lessons Completed
0
follow
Best Reply Awards
130
repos
Jun
23
9 hours ago
push

shqking push php/php-src

shqking
shqking

JIT/AArch64: Support shifted immediate (#7165)

  • JIT/AArch64: Support shifted immediate

As pointed out by MikePall in [1], shifted immediate value is supported. See [2]. For example, add x0, x1, #4096 would be encoded by DynASM into add x0, x1, #1, lsl #12 directly.

In this patch, a helper is added to check whether an immediate value is in the two allowed ranges: (1) 0 to 4095, and (2) LSL #12 on all the values from the first range.

Note that this helper works for add/adds/sub/subs/cmp/cmn instructions.

[1] https://github.com/LuaJIT/LuaJIT/pull/718 [2] https://github.com/LuaJIT/LuaJIT/blob/v2.1/dynasm/dasm_arm64.lua#L342

Change-Id: I4870048b9b8e6c429b73a4803af2a3b2d5ec0fbb

  • Deprecatd CMP_IMM/ADD_SUB_IMM and add test cases

Macros CMP_IMM and ADD_SUB_IMM are deprecated and instead we use this helper to guard the immediate encoding.

Add two 64-bit only test cases, since 64-bit integers are used and tested inside.

Change-Id: I0b42d4617b40372e2f4ce5b6ad31a4ddb7d89e49

commit sha: 3e164dee992db81516cd1443d0da1b5ef2a6325c

push time in 27 minutes ago
pull request

shqking pull request php/php-src

shqking
shqking

JIT/AArch64: Support shifted immediate

As pointed out by MikePall in [1], shifted immediate value is supported. See [2]. For example, add x0, x1, #4096 would be encoded by DynASM into add x0, x1, #1, lsl #12 directly.

In this patch, a helper is added to check whether an immediate value is in the two allowed ranges: (1) 0 to 4095, and (2) LSL #12 on all the values from the first range.

Note that this helper works for add/adds/sub/subs/cmp/cmn instructions.

[1] https://github.com/LuaJIT/LuaJIT/pull/718 [2] https://github.com/LuaJIT/LuaJIT/blob/v2.1/dynasm/dasm_arm64.lua#L342

Test: all ~4k .phpt test cases under tests/ Zend/tests/ ext/opcache/tests/jit/ can pass for Linux JIT/arm64. Note that in total 8 JIT variants are tested, covering ZTS/nonZTS, HYBRID/VM, and functional/tracing JIT.

Change-Id: I4870048b9b8e6c429b73a4803af2a3b2d5ec0fbb

open pull request

cmb69 wants to merge php/doc-en

cmb69
cmb69

Fix issues in memcached directory

Not sure about moving the note to parameters 🤔

cmb69
cmb69

Maybe use a <simplelist> here?

pull request

cmb69 merge to php/doc-en

cmb69
cmb69

Fix issues in memcached directory

Not sure about moving the note to parameters 🤔

cmb69
cmb69
pull request

cmb69 merge to php/doc-en

cmb69
cmb69

Fix issues in memcached directory

Not sure about moving the note to parameters 🤔

cmb69
cmb69
push

shiny push php/doc-zh

shiny
shiny

Update constants (#49)

  • Update constants

  • Update

commit sha: c8099d6d89ffca30737c234403cee586437a7be2

push time in 29 minutes ago
pull request

davisinfo pull request php/php-src

davisinfo
davisinfo

Fix #78987 - Memory problems running finfo::buffer

Fix #78987 - Memory problems running finfo::buffer

  • applied the original patch from the file library
pull request

davisinfo pull request php/php-src

davisinfo
davisinfo

Fix #78987 - Memory problems running finfo::buffer

Activity icon
issue

dstogov issue comment php/php-src

dstogov
dstogov

Fix bug 81111: Prevent serialization of anonymous classes

This is a pretty basic solution for preventing __serialize on anonymous classes for bug 81111.

It's probably not very elegant though...

This has the side effect of ignoring __serialize for classes that extend internal classes that use zend_class_serialize_deny. For example,

class Something extends CURLFile {
    public function __serialize() { return []; }
    public function __unserialize($value) { return new self('file'); }
}
var_dump(serialize(new Something('file')));
// Fatal error: Uncaught Exception: Serialization of 'Something' is not allowed

That seems like its better than allowing serialization. However, using __unserialize for a class that extends an internal class is still possible:

var_dump(unserialize('O:9:"Something":0:{}'));
// object(Something)#2 (3) {
//  ["name"]=>
//  string(0) ""
//  ["mime"]=>
//  string(0) ""
//  ["postname"]=>
//  string(0) ""
//}
dstogov
dstogov

It's also possible to disable declaration of __serialize/__unserialize methods for anonymous classes in first place (in compiler).

pull request

dstogov merge to php/php-src

dstogov
dstogov

Fix bug 81111: Prevent serialization of anonymous classes

This is a pretty basic solution for preventing __serialize on anonymous classes for bug 81111.

It's probably not very elegant though...

This has the side effect of ignoring __serialize for classes that extend internal classes that use zend_class_serialize_deny. For example,

class Something extends CURLFile {
    public function __serialize() { return []; }
    public function __unserialize($value) { return new self('file'); }
}
var_dump(serialize(new Something('file')));
// Fatal error: Uncaught Exception: Serialization of 'Something' is not allowed

That seems like its better than allowing serialization. However, using __unserialize for a class that extends an internal class is still possible:

var_dump(unserialize('O:9:"Something":0:{}'));
// object(Something)#2 (3) {
//  ["name"]=>
//  string(0) ""
//  ["mime"]=>
//  string(0) ""
//  ["postname"]=>
//  string(0) ""
//}
dstogov
dstogov

The patch is OK for me. I'm not completely sure how it it's going to work after removing Serializable interface. (It's already deprecated in 8.1).

I think, it way be easier to check ZEND_ACC_ANON_CLASS flag. @nikic please take a look

pull request

saundefined pull request php/doc-en

saundefined
saundefined

Fix issues in memcached directory

pull request

nikic merge to php/php-src

nikic
nikic

JIT/AArch64: Support shifted immediate

As pointed out by MikePall in [1], shifted immediate value is supported. See [2]. For example, add x0, x1, #4096 would be encoded by DynASM into add x0, x1, #1, lsl #12 directly.

In this patch, a helper is added to check whether an immediate value is in the two allowed ranges: (1) 0 to 4095, and (2) LSL #12 on all the values from the first range.

Note that this helper works for add/adds/sub/subs/cmp/cmn instructions.

[1] https://github.com/LuaJIT/LuaJIT/pull/718 [2] https://github.com/LuaJIT/LuaJIT/blob/v2.1/dynasm/dasm_arm64.lua#L342

Test: all ~4k .phpt test cases under tests/ Zend/tests/ ext/opcache/tests/jit/ can pass for Linux JIT/arm64. Note that in total 8 JIT variants are tested, covering ZTS/nonZTS, HYBRID/VM, and functional/tracing JIT.

Change-Id: I4870048b9b8e6c429b73a4803af2a3b2d5ec0fbb

open pull request

shiny wants to merge php/doc-zh

shiny
shiny

Update constants

shiny
shiny

原文中是 const keyword 和 define function,keyword 和 function 属于对应关系,但这里只体现出了“函数”

open pull request

shiny wants to merge php/doc-zh

shiny
shiny

Update constants

shiny
shiny

“作用域” 是个固定的术语,不应当翻译成“作用区域”。读者不易理解。

open pull request

shiny wants to merge php/doc-zh

shiny
shiny

Update constants

shiny
shiny

小建议:括号内的还能看出来是英语直接翻译过来,英文逗号改成中文逗号,and 翻译成了“和”。 中文的表达方式应该是顿号,而且这个“和”也是无必要的。

open pull request

shiny wants to merge php/doc-zh

shiny
shiny

Update constants

shiny
shiny

这里未改的原译也很难读懂。 原文:

Prior to PHP 8.0.0, undefined constants would be interpreted as a bare word string, i.e. (CONSTANT vs "CONSTANT").

翻译:

在 PHP 8.0.0 之前,PHP 假定想要的是该常量本身的名字,如同用字符串调用它一样(CONSTANT 对应 "CONSTANT")。

open pull request

shiny wants to merge php/doc-zh

shiny
shiny

Update constants

shiny
shiny

下面一段落 the <function>constant</function> function 中有新增 thefunction ,大概是为了强调 <function>constant</function> 是个函数。中文版没有体现出来。

started
started time in 2 hours ago
push

saundefined push php/doc-ru

saundefined
saundefined

Обновление до английской версии

commit sha: 688423a68e1eba95569355abfcdf1f92e930d250

push time in 2 hours ago
Activity icon
fork

Butcher21364 forked php/php-src

⚡ The PHP Interpreter
Butcher21364 Updated
fork time in 3 hours ago
Activity icon
fork

davisinfo forked php/php-src

⚡ The PHP Interpreter
davisinfo Updated
fork time in 3 hours ago
Activity icon
issue

krakjoe issue comment php/php-src

krakjoe
krakjoe

Remove " " being considered as an invalid filename for `is_file()`

Some builds fail because of it, last one to date is: https://travis-ci.com/github/php/php-src/jobs/517817543

krakjoe
krakjoe

Nowadays, we don't test ZPP, and will refuse to merge such tests. This test was clearly written to test the 'p' specifier for ZPP, and some false assumptions were made about how paths were handled at that time.

IMO the test should be removed, or rewritten so that it makes sense. If this test provides no additional coverage to php_stat, then drop it.

started
started time in 3 hours ago