Register Register Member Login Member Login Member Login Forgot Password ??
PHP , ASP , ASP.NET, VB.NET, C#, Java , jQuery , Android , iOS , Windows Phone
 

Registered : 109,027

HOME > PHP > PHP Forum > [2020:PhrayaDev] [พูดคุย] - ชอบของเล่นชิ้นไหนใน PHP 8?



 

[2020:PhrayaDev] [พูดคุย] - ชอบของเล่นชิ้นไหนใน PHP 8?

 



Topic : 135167



โพสกระทู้ ( 1,458 )
บทความ ( 0 )



สถานะออฟไลน์
Twitter Facebook Blogger



https://stitcher.io/blog/new-in-php-8

ใครชอบ และ/หรือ ไม่ชอบอะไรบ้าง





ถ้ามาตามนั้นจริง JIT แจ่ม นอกนั้นเฉยๆ (กำลังกลายพันธุ์เป็น .x )



Tag : PHP







Move To Hilight (Stock) 
Send To Friend.Bookmark.
Date : 2020-04-27 20:41:45 By : PhrayaDev View : 2107 Reply : 12
 

 

No. 2



โพสกระทู้ ( 1,458 )
บทความ ( 0 )



สถานะออฟไลน์
Twitter Facebook Blogger

Quote:
หลังจากงมมาหลายเดือนกับการปั่นกระทู้ไข่(และ/หรือ เน่า) ที่ TC ประจำทศวรรษที่ 201
ในที่สุดก็ปิดภารกิจลงได้อย่าง Happy Ending ตัวละครเอกในช่วงปลายเรื่องจะมี
คำหยาบ คำสบถปนอยู่บ้าง(หรือไม่น้อย) ...คนที่ผ่านเข้ามาอ่านทีหลัง(อย่างจริงจัง)
ก็กลั่นกรองเอา สิ่งไหนดีก็รับไว้ อะไรไม่ดีก็ตัดทิ้งไป อย่าคิดอะไรมาก ให้รู้จักผ่อนหนักเบา..
แล้วเจอกันใหม่กับภารกิจทุบไข่ประจำทศวรรษที่ 202 ในอีก 10 ปี (ถ้า TC ยังอยู่)
:lol
:

ก่อนไปจุติ จะลอง test PHP 8 Feature freeze ที่จะคลอดพรุ่งนี้
ไว้ที่กระทู้นี้ หลักๆ ก็จะลอง JIT ดูว่าการทำงานของ Opcache จะเป็นอย่างไร


PHP8



https://kinsta.com/blog/php-8/






แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2020-08-03 13:48:45 By : PhrayaDev
 


 

No. 3



โพสกระทู้ ( 1,458 )
บทความ ( 0 )



สถานะออฟไลน์
Twitter Facebook Blogger

(การทดสอบต่อไปนี้เป็นแค่แบบหยาบๆ ยังไม่ได้ดึงศักยภาพของ PHP8 ออกมาทั้งหมด)

PHP version test: PHP 8 - beta1 (x64/TS - QA release)
Web Server Software : Apache 2.4.46 Win64

Quote:
ขั้นตอนการติดตั้งอย่างคร่าวๆ (ส่วนใหญ่คงทำเป็นหมดแล้ว...และแน่นอนว่าคงมีขั้นตอนที่ถูกข้ามไป)
1. หลังจากโหลดมาแล้วติดตั้ง apache ก่อนแล้วตามด้วย PHP8-beta1
2. กำหนดและตั้งค่าใน httpd.conf จนพอใจ
3. เพิ่ม PATH ให้ชี้ไปยังที่อยู่ PHP ใน Environment Variables
4. สร้างไฟล์ php.ini กำหนดค่าและทดสอบว่า server ทำงานหรือไม่



8QA01

8QA02


Quote:
การเปิด OPcache
zend_extension=opcache

ปิด OPcache
;zend_extension=opcache



8QA03

8QA04


Quote:
ใช้ JIT (แบบเดียวที่ใช้ได้สำหรับเวอร์ชัน QA)
opcache.jit_buffer_size=100M
opcache.jit=1205

ยกเลิก JIT
;opcache.jit_buffer_size=100M
;opcache.jit=1205

หรือลบสองบรรทัดนี้เลยก็ได้


https://wiki.php.net/rfc/jit




การทดสอบ

1. JIT - (Mandelbrot benchmark)

jit.php
<?php
define("BAILOUT",16);
define("MAX_ITERATIONS",1000);

class Mandelbrot
{
    function Mandelbrot()
    {
        $d1 = microtime(1);
        for ($y = -39; $y < 39; $y++) {
            for ($x = -39; $x < 39; $x++) {

                if ($this->iterate($x/40.0,$y/40.0) == 0) 
                    echo("*");
                else
                    echo(" ");

            }
            echo("\n");
        }
        $d2 = microtime(1);
        $diff = $d2 - $d1;
        printf("\nPHP Elapsed %0.3f\n", $diff);
    }

    function iterate($x,$y)
    {
        $cr = $y-0.5;
        $ci = $x;
        $zr = 0.0;
        $zi = 0.0;
        $i = 0;
        while (true) {
            $i++;
            $temp = $zr * $zi;
            $zr2 = $zr * $zr;
            $zi2 = $zi * $zi;
            $zr = $zr2 - $zi2 + $cr;
            $zi = $temp + $temp + $ci;
            if ($zi2 + $zr2 > BAILOUT)
                return $i;
            if ($i > MAX_ITERATIONS)
                return 0;
        }
    
    }


}

ob_start();
$m = new Mandelbrot();
$m->Mandelbrot();
ob_end_flush();
?>


ผล (หน่วยเป็น วินาที ยิ่งน้อยยิ่งดี)
1. ไม่เปิด OPcache ...* * * PHP Elapsed 0.16x 2. เปิด OPcache ...* * * PHP Elapsed 0.08x 3. เปิด OPcache + ใช้ JIT ...* * * PHP Elapsed 0.030


ข้อสังเกต
จะเห็นความแตกต่างเมื่อมี OPCache การทำงานจะเร็วขึ้น 2 เท่าเมื่อเทียบกับตอนยังไม่มี OPcache
และตอนใช้ OPcache + JIT จะเร็วกว่า OPcache อย่างเดียว ถึง 2.67 เท่า และ
OPcache + JIT เร็วกว่าแบบไม่มี OPcache ถึง 5 เท่า ...แต่
ยังไม่ได้ตามที่ทีมงาน PHP ได้ทดสอบเอาไว้ที่ 0.011 sec ซึ่งอาจเป็นผลมาจากหลายปัจจัย
ไม่ว่าจะเป็น OS, build/compile, system environment settings, configurations ฯลฯ




2. Named arguments (ถือกำเนิดใน beta1)

narg.php
​<!DOCTYPE html>
<html>
<body>

<?php
function foo(string $a, string $b, ?string $c = null, ?string $d = null) {
	echo "a: $a, b: $b, c: $c, d: $d";
}

foo(
    b: 'value b', 
    a: 'value a', 
    d: 'value d',
);
?>  

</body>
</html>



ผล*
a: value a, b: value b, c: , d: value d


* หมายเหตุ ใน PHP7, 8alpha3 จะได้ parsed error




อย่างที่กล่าวไปแล้วข้างต้น การทดสอบนี้เป็นแค่การทำความรู้จักกับ PHP8 เท่านั้น...ลองไปศึกษาและเล่นกันดูครับ
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2020-08-05 20:27:20 By : PhrayaDev
 

 

No. 4



โพสกระทู้ ( 1,458 )
บทความ ( 0 )



สถานะออฟไลน์
Twitter Facebook Blogger

Quote:
กระทู้ที่ผ่านไปแล้ว 7 วันจะไม่สามารถแก้ไขได้


งั้นก็วางไว้ตรงนี้แทนแล้วกัน
สำหรับใครที่สงสัยว่า PHP8 มีอะไรต่างจาก PHP7

คุณลักษณะที่ถูกเพิ่มเข้ามาใน PHP8
======================================== New Features ======================================== - Core: . Added support for union types. RFC: https://wiki.php.net/rfc/union_types_v2 . Added WeakMap. RFC: https://wiki.php.net/rfc/weak_maps . Added ValueError class. . Any number of function parameters may now be replaced by a variadic argument, as long as the types are compatible. For example, the following code is now allowed: Code (PHP8)
        class A {
            public function method(int $many, string $parameters, $here) {}
        }
        class B extends A {
            public function method(...$everything) {}
        }
. "static" (as in "late static binding") can now be used as a return type: Code (PHP8)
        class Test {
            public function create(): static {
                return new static();
            }
        }
RFC: https://wiki.php.net/rfc/static_return_type . It is now possible to fetch the class name of an object using `$object::class`. The result is the same as `get_class($object)`. RFC: https://wiki.php.net/rfc/class_name_literal_on_object . New and instanceof can now be used with arbitrary expressions, using `new (expression)(...$args)` and `$obj instanceof (expression)`. RFC: https://wiki.php.net/rfc/variable_syntax_tweaks . Some consistency fixes to variable syntax have been applied, for example writing `Foo::BAR::$baz` is now allowed. RFC: https://wiki.php.net/rfc/variable_syntax_tweaks . Added Stringable interface, which is automatically implemented if a class defines a __toString() method. RFC: https://wiki.php.net/rfc/stringable . Traits can now define abstract private methods. RFC: https://wiki.php.net/rfc/abstract_trait_method_validation . `throw` can now be used as an expression. RFC: https://wiki.php.net/rfc/throw_expression . An optional trailing comma is now allowed in parameter lists. RFC: https://wiki.php.net/rfc/trailing_comma_in_parameter_list . It is now possible to write `catch (Exception)` to catch an exception without storing it in a variable. RFC: https://wiki.php.net/rfc/non-capturing_catches . Added support for mixed type RFC: https://wiki.php.net/rfc/mixed_type_v2 . Added support for Attributes RFC: https://wiki.php.net/rfc/attributes_v2 RFC: https://wiki.php.net/rfc/attribute_amendments RFC: https://wiki.php.net/rfc/shorter_attribute_syntax . Added support for constructor property promotion (declaring properties in the constructor signature). RFC: https://wiki.php.net/rfc/constructor_promotion . Added support for `match` expression. RFC: https://wiki.php.net/rfc/match_expression_v2 . Private methods declared on a parent class no longer enforce any inheritance rules on the methods of a child class. (with the exception of final private constructors) RFC: https://wiki.php.net/rfc/inheritance_private_methods . Added support for nullsafe operator (`?->`). RFC: https://wiki.php.net/rfc/nullsafe_operator . Added support for named arguments. RFC: https://wiki.php.net/rfc/named_params - Date: . Added DateTime::createFromInterface() and DateTimeImmutable::createFromInterface(). . Added the DateTime format specifier "p" which is the same as "P" but returning "Z" for UTC. - Dom: . Introduce DOMParentNode and DOMChildNode with new traversal and manipulation APIs. RFC: https://wiki.php.net/rfc/dom_living_standard_api - Enchant: . enchant_dict_add() . enchant_dict_is_added() . LIBENCHANT_VERSION macro - FPM: . Added a new option pm.status_listen that allows getting status from different endpoint (e.g. port or UDS file) which is useful for getting status when all children are busy with serving long running requests. - Hash: . HashContext objects can now be serialized. - Opcache: . If the opcache.record_warnings ini setting is enabled, opcache will record compile-time warnings and replay them on the next include, even if it is served from cache. - OpenSSL: . Added Cryptographic Message Syntax (CMS) (RFC 5652) support composed of functions for encryption, decryption, signing, verifying and reading. The API is similar to the API for PKCS #7 functions with an addition of new encoding constants: OPENSSL_ENCODING_DER, OPENSSL_ENCODING_SMIME and OPENSSL_ENCODING_PEM. - Standard: . printf() and friends now support the %h and %H format specifiers. These are the same as %g and %G, but always use "." as the decimal separator, rather than determining it through the LC_NUMERIC locale. . printf() and friends now support using "*" as width or precision, in which case the width/precision is passed as an argument to printf. This also allows using precision -1 with %g, %G, %h and %H. For example, the following code can be used to reproduce PHP's default floating point formatting: Code (PHP8)
        printf("%.*H", (int) ini_get("precision"), $float);
        printf("%.*H", (int) ini_get("serialize_precision"), $float);
. proc_open() now supports pseudo-terminal (PTY) descriptors. The following attaches stdin, stdout and stderr to the same PTY: Code (PHP8)
        $proc = proc_open($command, [['pty'], ['pty'], ['pty']], $pipes);
. proc_open() now supports socket pair descriptors. The following attaches a distinct socket pair to stdin, stdout and stderr: Code (PHP8)
        $proc = proc_open(
            $command, [['socket'], ['socket'], ['socket']], $pipes);
Unlike pipes, sockets do not suffer from blocking I/O issues on Windows. However, not all programs may work correctly with stdio sockets. . Sorting functions are now stable, which means that equal-comparing elements will retain their original order. RFC: https://wiki.php.net/rfc/stable_sorting - Zip: . Extension updated to version 1.19.0 . New ZipArchive::lastId property to get index value of last added entry. . Error can be checked after an archive is closed using ZipArchive::status, ZipArchive::statusSys properties or ZipArchive::getStatusString() method. . The remove_path option of ZipArchive::addGlob() and ::addPattern() is now treated as arbitrary string prefix (for consistency with the add_path option), whereas formerly it was treated as directory name. . Optional compression / encryption features are listed in phpinfo.




- การเปลี่ยนแปลงฉบับเต็ม: https://raw.githubusercontent.com/php/php-src/php-8.0.0beta1/UPGRADING
- แค่คัดลอกมาใส่ลิงค์ ไม่ได้แปลเพราะคิดว่าไม่จำเป็น
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2020-08-07 13:36:05 By : PhrayaDev
 


 

No. 5



โพสกระทู้ ( 1,458 )
บทความ ( 0 )



สถานะออฟไลน์
Twitter Facebook Blogger

จะตั้งใหม่ก็ "พอกะเทิน"

Quote:
...เนื่องจาก beta2 ไม่มีอะไรเปลี่ยนแปลงจากเดิม แก้บักเล็กๆ น้อยๆ (beta-RC เน้น Bug Test)
และจากที่พบว่ามีหลายคนไม่ถูกโฉลกกับภาษาอังกฤษ ผนวกกับความอยากรู้อยากเห็นที่ฝังใจเมื่อ 25 ปีก่อน
...จึงเกิดไอเดียประดิษฐ์คิดค้น Thai lexer modification สำหรับ PHP8


- ทำไมไม่ทำเป็น extension หรือใช้ parle?
...เพราะการทำ extension และ/หรือ ใช้ extension parle ต้องใช้เวลาศึกษาและพัฒนานานกว่าแบบ Hard Core

- ทำไปเพื่ออะไร?
...หลักๆ เพื่อความเพลิดเพลิน ดั่งการพิสูจน์ว่า "ทำเรื่องง่ายให้เป็นเรื่องยาก" PHP ยากแค่ไหน Thaiway ยากยิ่งกว่า (ที่ไหน)

- กลุ่มเป้าหมาย
โปรแกรมเมอร์ที่สนใจสิ่งแปลกใหม่ทุกระดับความรู้และความสามารถ

- ชื่อโปรเจค
Thaiway for PHP

- ระยะเวลาในการศึกษาและดำเนินการสร้างโปรเจค
เบ็ดเสร็จ 2 วัน ทำจริงทั้งระบบ 11 ชม. ทำเฉพาะ lexer 3 ชม.

OS target: Ubuntu 18.04.5 LTS
PHP Source: PHP8 Master @ 23-08-2020 17.00 น. UTC+7




สรุปผลและขั้นตอน

1. ติดตั้ง dependencies ทั้งหมดที่ใช้ในการ build PHP8 (เสียเวลาตรงนี้ไป 7 ชม
...ทีแรกใช้ Ubuntu 17.04 แต่ต้อง modify เองเยอะเพื่อรองรับการ build PHP8...จึงล้มเลิกกลางคัน )

2. ดาวน์โหลดซอส (โคลน git)
3. แก้ซอสโค้ด - php lexer (นานกับการคิดคำศัพท์ให้สื่อความหมายเข้าใจง่ายที่สุดเท่าที่จะทำได้)
4. จัดการ config
5. build Thaiway ด้วย make + Test
6. install Thaiway binary + check ดูผลงาน

build+test


7. ทดสอบการเขียนโค้ดด้วยคำสั่งภาษาไทย

php8-thaiway

8. ผ่ามผ๊าม ...จบข่าว
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2020-08-23 23:32:42 By : PhrayaDev
 


 

No. 6



โพสกระทู้ ( 1,458 )
บทความ ( 0 )



สถานะออฟไลน์
Twitter Facebook Blogger

Thaiway XX823

คำสั่งภาษาไทย
Eng ไทย ที่มา exit ออก die ตาย fn วธ วิธี function วิธี const คง คงที่ return คืน คืนค่า yield ผล ผลที่คาดหวังจะได้รับ from จาก try ลอง catch จับ finally ท้าย สุดท้าย throw โยน if ถ้า elseif แต่ถ้า endif จบถ้า else ไม่งั้น while เมื่อ endwhile จบเมื่อ do ทำ for วน endfor จบวน foreach วนละ endforeach จบวนละ declare ประกาศ enddeclare จบประกาศ instanceof กรณีของ as เป็น switch เลือก match คู่ endswitch จบเลือก case กรณี default อย่างอื่น break หยุด continue ทำต่อ goto ไปยัง echo แสดง print สำแดง class แบบ interface ต่อหน้า trait พิมพ์เขียว extends ขยาย implements จัดให้ new สร้าง clone ปั๊ม var แปร (int|integer) (เต็ม) cast (double|float) (จริง) cast (string|binary) (ความ) cast (object) (วัตถุ) cast (bool|boolean) (ตรรก) cast (unset) (ถอด) cast eval รันโค้ด include แนบ include_once แนบสด require ต้องแนบ require_once ต้องแนบสด namespace อาณา อาณาจักร use ใช้ insteadof แทน global ทั่วฟ้า มีใช้ทุกที่ isset มี มีอยู่หรือไม่ empty ว่าง ว่างหรือไม่ static สถิต abstract ปรารภ นามธรรม ยังไม่มีรูป final ห้าม ห้ามคลาสลูกขึ้นขี่หลัง (no overriding) private ส่วนตัว ใช้ได้เฉพาะคลาสปัจจุบัน protected ทายาท ใช้ได้เฉพาะคลาสลูก (ทายาท) public สาธา สาธารณะ unset ถอน list ราย รายการ array มิติ callable เรียกได้


Linux: ดาวน์โหลด


ประวัติการแก้ไข
2020-08-24 20:26:33
2020-08-24 20:27:30
2020-08-24 20:27:54
2020-08-24 20:29:01
2020-08-24 20:31:12
2020-08-24 20:34:59
2020-08-24 20:35:30
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2020-08-24 20:20:09 By : PhrayaDev
 


 

No. 7



โพสกระทู้ ( 1,458 )
บทความ ( 0 )



สถานะออฟไลน์
Twitter Facebook Blogger

PHP 8.0.0beta3
NEWS (แก้บัก) https://raw.githubusercontent.com/php/php-src/php-8.0.0beta3/NEWS - Calendar: . Fixed bug #80007 (Potential type confusion in unixtojd() parameter parsing). (Andy Postnikov) - COM: . Fixed bug #55847 (DOTNET .NET 4.0 GAC new location). (cmb) - DOM: . Fixed bug #79968 (DOMChildNode API crash on unattached nodes). (Benjamin) - Fileinfo: . Upgrade to libmagic 5.39. (Anatol) - Opcache: . Fixed bug #80030 (Optimizer segfault with isset on static property with undef dynamic class name). (Nikita) UPGRADING (การเปลี่ยนแปลง) https://raw.githubusercontent.com/php/php-src/php-8.0.0beta3/UPGRADING - OCI8: (เปลี่ยนชื่อคลาส) . The OCI-Lob class is now called OCILob, and the OCI-Collection class is now called OCICollection for name compliance enforced by PHP 8 arginfo type annotation tooling. - com.dotnet_version (เพิ่มตัวเลือก .NET ใน php.ini) . New INI directive to choose the version of the .NET framework to use for dotnet objects.

แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2020-09-03 13:22:55 By : PhrayaDev
 


 

No. 8



โพสกระทู้ ( 1,458 )
บทความ ( 0 )



สถานะออฟไลน์
Twitter Facebook Blogger

PHP 8.0.0beta4
NEWS - Core: . Implement #[Attr] Attribute syntax as per final vote in RFC https://wiki.php.net/rfc/shorter_attribute_syntax_change . Fixed bug #80045 (memleak after two set_exception_handler calls with __call). (Nikita) . Fixed bug #80096 (Segmentation fault with named arguments in nested call). (Nikita) . Fixed faulty generator cleanup with yield from. (Bob) - Date: . Fixed bug #80057 (DateTimeImmutable::createFromFormat() does not populate time). (Derick) - FFI: . Added FFI\CType::getName() method. (chopins) https://raw.githubusercontent.com/php/php-src/php-8.0.0beta4/NEWS UPGRADING - Core: . Following the hash comment operator # immediately with an opening bracket is not supported as a comment anymore since this syntax is now used for attributes. RFC: https://wiki.php.net/rfc/shorter_attribute_syntax_change . Compile time fatal error "Only variables can be passed by reference" has been delayed until runtime and converted to "Argument cannot be passed by reference" exception. . Some "Only variables should be passed by reference" notices have been converted to "Argument cannot be passed by reference" exception. . Added support for Attributes RFC: https://wiki.php.net/rfc/attributes_v2 RFC: https://wiki.php.net/rfc/attribute_amendments RFC: https://wiki.php.net/rfc/shorter_attribute_syntax RFC: https://wiki.php.net/rfc/shorter_attribute_syntax_change - OpenSSL: . openssl_seal() and openssl_open() now require $method to be passed, as the previous default of "RC4" is considered insecure. - pgsql: . The deprecated pg_connect() syntax using multiple parameters instead of a connection string is no longer supported. . The deprecated pg_lo_import() and pg_lo_export() signature that passes the connection as the last argument is no longer supported. The connection should be passed as first argument instead. - Standard: . Calling crypt() without an explicit salt is no longer supported. If you would like to produce a strong hash with an auto-generated salt, use password_hash() instead. . array_diff(), array_intersect() and their variations can now be used with a single array as argument. This means that usages like the following are now possible: Code (PHP8)
        // OK even if $excludes is empty.
        array_diff($array, ...$excludes);
        // OK even if $arrays only contains a single array.
        array_intersect(...$arrays);
https://raw.githubusercontent.com/php/php-src/php-8.0.0beta4/UPGRADING



อัปเดตตารางเวลา (Timetable)

PHP8 Timetable
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2020-09-18 15:08:41 By : PhrayaDev
 


 

No. 9



โพสกระทู้ ( 1,458 )
บทความ ( 0 )



สถานะออฟไลน์
Twitter Facebook Blogger

PHP 8.0.0rc1
NEWS - CLI: . Allow debug server binding to an ephemeral port via `-S localhost:0`. (Sara) - Core: . Fixed bug #80109 (Cannot skip arguments when extended debug is enabled). (Nikita) - ODBC: . Fixed bug #22986 (odbc_connect() may reuse persistent connection). (cmb) - PDO_Firebird: . Fixed bug #64937 (Firebird PDO preprocessing sql). (Simonov Denis) - SPL: . SplFixedArray is now IteratorAggregate rather than Iterator. (alexdowad) - Zlib: . Fixed bug #78792 (zlib.output_compression disabled by Content-Type: image/). (cmb) https://raw.githubusercontent.com/php/php-src/php-8.0.0rc1/NEWS UPGRADING - Core: . call_user_func_array() array keys will now be interpreted as parameter names, instead of being silently ignored. - IMAP: . The unused default_host argument of imap_headerinfo() has been removed. . The imap_header() function which is an alias of imap_headerinfo() has been removed. - ODBC: . odbc_connect() no longer reuses persistent connections. . The unused flags parameter of odbc_exec() has been removed. - MySQLi / PDO MySQL: . When mysqlnd is not used (which is the default and recommended option), the minimum supported libmysqlclient version is now 5.5. - PGSQL / PDO PGSQL: . pg_fetch_all() will now return an empty array instead of false for result sets with zero rows. . Function aliases in the pgsql extension have been deprecated. - SPL: . SplFixedArray is now an IteratorAggregate and not an Iterator. SplFixedArray::rewind(), ::current(), ::key(), ::next(), and ::valid() have been removed. In their place, SplFixedArray::getIterator() has been added. Any code which uses explicit iteration over SplFixedArray must now obtain an Iterator through SplFixedArray::getIterator(). This means that SplFixedArray is now safe to use in nested loops. - Standard: . The $flag parameter of ob_implicit_flush() was changed to accept bool values rather than int. - Sysvsem: . The $auto_release parameter of sem_get() was changed to accept bool values rather than int. - Zip: . Extension updated to version 1.19.1 - Zlib: . zlib.output_compression is no longer automatically disabled for Content-Type: image/*. https://raw.githubusercontent.com/php/php-src/php-8.0.0rc1/UPGRADING




Next post will be on GA release date. Whoever can update, do it!


ประวัติการแก้ไข
2020-10-01 04:22:06
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2020-10-01 04:19:48 By : PhrayaDev
 


 

No. 10



โพสกระทู้ ( 1,458 )
บทความ ( 0 )



สถานะออฟไลน์
Twitter Facebook Blogger

PHP8_LOGO

PHP 8.0.0 Stable Release
https://www.php.net/releases/8.0/en.php
ดาวน์โหลดไปลองเล่นดูได้
https://www.php.net/downloads

แต่ยังไม่แนะนำให้นำไปใช้ในงานจริง ถึงจะเป็น Stable แล้ว
(ไม่มี .."Please DO NOT use this version in production, it is an early test version.")

เพราะโค้งสุดท้ายพี่แกค่อนข้างเร่งเครื่องเพื่อปิดตามกำหนดการเดิมทั้งที่ยังเก็บกวาดได้ไม่เกลี้ยงเท่าไร
(แต่ก็แล้วแต่ความพอใจของท่านเอง)

ด้วยเหตุนี้จึงขอเลื่อนโปรเจค Thaiway ออกไปก่อนโดยไม่มีกำหนดการที่แน่นอน หรืออาจยกเลิก


PHP 8 จะมีอะไรใหม่ที่ถูกใจใครบ้างก็ไปชิมกันเอาเอง...ไม่นานเอกสารการใช้งานฉบับปรับปรุงคงจะตามมา






This is my last post on topic.
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2020-11-27 11:00:28 By : PhrayaDev
 


 

No. 11



โพสกระทู้ ( 4,720 )
บทความ ( 8 )



สถานะออฟไลน์


https://www.php.net/manual/en/migration80.deprecated.php
https://www.php.net/manual/en/migration80.incompatible.php

ความฉิบ+หายนะมาเยือนใครบ้าง 555

ผมนี่โดนไปหลายดอกละ call_user_func_array(), parse_url()

แล้วยังโดน phpunit มันบังคับ return type : void อีก ฉิบฯ 2 รอบ 2 เด้ง!!

คือจากเดิมที่เขียนโค้ดแจก ทำให้มันรองรับได้กว้างๆตั้งแต่ PHP 7.0 ขึ้นไปถึง 7.4 มันสามารถทำ unit test ได้ครบหมดทุก version
แต่พอมาจะให้รองรับ 8.0 ด้วย phpunit ต้องใช้รุ่น 9 ซึ่งตัว setup() และ tearDown() บังคับต้องมี : void เป็น declaration return type
ทีนี้ความฉิบก็มาเพราะ test ไม่ผ่าน และถ้าจะให้ผ่านก็ต้องดันรุ่น php ให้รองรับขั้นต่ำ 7.1 เพื่อทำ : void return type ให้ตรงกับ class แม่ ซึ่งคนใช้ 7.0 ก็ไม่ต้องใช้กัน...

ก็ไม่เข้าใจทั้งคนทำภาษา php และคนทำ phpunit ทำไมมันถึงชอบทำลายของเก่ากันนัก
ทั้งที่มันทำให้คนเขาใช้ต่อเนื่องไปก็ได้ แล้วเน้นที่เพิ่มความสามารถใหม่ๆเอา แทนที่จะทำลายความสามารถเก่าๆ
มันสนุกตรงไหนต้องมาตามแก้ความวอดวาย-วายวอดเหล่านี้?
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2020-11-27 21:51:20 By : mr.v
 


 

No. 12



โพสกระทู้ ( 9,559 )
บทความ ( 2 )



สถานะออฟไลน์


ตอบความคิดเห็นที่ : 11 เขียนโดย : mr.v เมื่อวันที่ 2020-11-27 21:51:20
รายละเอียดของการตอบ ::
เห็นด้วยครับ ผิด concept inherit นี่มันเหมือนโปรแกรมใหม่เลย น่าจะตั้งชื่อใหม่เลยเป็น PHP8
ไม่ใช่ php.8 หรือว่าเราเข้าใจผิดกันไปเอง เขาตั้งชื่อ PHP8 ถูกต้องแล้ว ไม่ใช่ php.8 (php จุด 8)

แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2020-11-28 06:25:07 By : Chaidhanan
 


 

No. 13



โพสกระทู้ ( 4,720 )
บทความ ( 8 )



สถานะออฟไลน์


ตามนั่งอัพเดทโค้ด โดนหลายตัวเลยครับ

vsprintf() แต่เดิม argument ที่ 2 จะหยวนให้เป็น string ได้ แต่ตอนนี้ต้องเป็น array เท่านั้น.

imagecreatexxx() ทั้งหลาย ที่มันต้อง return resource ก็ทะลึ่ง return \GDImage class ซึ่งมันผิดไปหมดเลย มันทำให้กระบวนการเละเทะไปหมด การเช็ค resource ต้องตามแก้ทั้งหมด แถมยังต้องมาเช็คให้รองรับ php 7 (resource), php 8 (object) แลดูมั่วสะเปะสะปะไปเลย

imagedestroy() แต่เดิมถ้าตัวแปรส่งไปไม่ใช่ resource ก็จะ error แต่ 8.0 ไม่สนไม่ error ทั้งสิ้น. พอมาเจอกับการที่ return resource เปลี่ยนเป็น object การเช็คก่อน destroy ใน php รุ่นก่อนหน้า 8 ทั้งหมด ต้องตามเปลี่ยนโค้ดหมดเลย!!
Code (PHP)
if (is_resource($image) && get_resource_type($image) === 'gd') {
    imagedestroy($image);
}

เป็น
Code (PHP)
if (
    (is_resource($image) && get_resource_type($image) === 'gd') || 
    (is_object($image) && $image instanceof \GDImage)
) {
    imagedestroy($image);
}




ในภาษาอื่นๆอย่างเช่น Python, C# (.net) มันมีกระบวนการหักหลัง dev แบบนี้บ้างมั้ยครับเนี่ย?


ประวัติการแก้ไข
2020-11-28 09:58:11
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2020-11-28 09:54:45 By : mr.v
 

   

ค้นหาข้อมูล


   
 

แสดงความคิดเห็น
Re : [2020:PhrayaDev] [พูดคุย] - ชอบของเล่นชิ้นไหนใน PHP 8?
 
 
รายละเอียด
 
ตัวหนา ตัวเอียง ตัวขีดเส้นใต้ ตัวมีขีดกลาง| ตัวเรืองแสง ตัวมีเงา ตัวอักษรวิ่ง| จัดย่อหน้าอิสระ จัดย่อหน้าชิดซ้าย จัดย่อหน้ากึ่งกลาง จัดย่อหน้าชิดขวา| เส้นขวาง| ขนาดตัวอักษร แบบตัวอักษร
ใส่แฟลช ใส่รูป ใส่ไฮเปอร์ลิ้งค์ ใส่อีเมล์ ใส่ลิ้งค์ FTP| ใส่แถวของตาราง ใส่คอลัมน์ตาราง| ตัวยก ตัวห้อย ตัวพิมพ์ดีด| ใส่โค้ด ใส่การอ้างถึงคำพูด| ใส่ลีสต์
smiley for :lol: smiley for :ken: smiley for :D smiley for :) smiley for ;) smiley for :eek: smiley for :geek: smiley for :roll: smiley for :erm: smiley for :cool: smiley for :blank: smiley for :idea: smiley for :ehh: smiley for :aargh: smiley for :evil:
Insert PHP Code
Insert ASP Code
Insert VB.NET Code Insert C#.NET Code Insert JavaScript Code Insert C#.NET Code
Insert Java Code
Insert Android Code
Insert Objective-C Code
Insert XML Code
Insert SQL Code
Insert Code
เพื่อความเรียบร้อยของข้อความ ควรจัดรูปแบบให้พอดีกับขนาดของหน้าจอ เพื่อง่ายต่อการอ่านและสบายตา และตรวจสอบภาษาไทยให้ถูกต้อง

อัพโหลดแทรกรูปภาพ

Notice

เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ
อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง

   
  เพื่อความปลอดภัยและการตรวจสอบ กระทู้ที่แทรกไฟล์อัพโหลดไฟล์จากที่อื่น อาจจะถูกลบทิ้ง
 
โดย
อีเมล์
บวกค่าให้ถูก
<= ตัวเลขฮินดูอารบิก เช่น 123 (หรือล็อกอินเข้าระบบสมาชิกเพื่อไม่ต้องกรอก)







Exchange: นำเข้าสินค้าจากจีน, Taobao, เฟอร์นิเจอร์, ของพรีเมี่ยม, ร่ม, ปากกา, power bank, แฟลชไดร์ฟ, กระบอกน้ำ

Load balance : Server 01
ThaiCreate.Com Logo
© www.ThaiCreate.Com. 2003-2024 All Rights Reserved.
ไทยครีเอทบริการ จัดทำดูแลแก้ไข Web Application ทุกรูปแบบ (PHP, .Net Application, VB.Net, C#)
[Conditions Privacy Statement] ติดต่อโฆษณา 081-987-6107 อัตราราคา คลิกที่นี่