[Osaka/Yokohama/Tokushima] Looking for infrastructure/server side engineers!

[Osaka/Yokohama/Tokushima] Looking for infrastructure/server side engineers!

[Deployed by over 500 companies] AWS construction, operation, maintenance, and monitoring services

[Deployed by over 500 companies] AWS construction, operation, maintenance, and monitoring services

[Successor to CentOS] AlmaLinux OS server construction/migration service

[Successor to CentOS] AlmaLinux OS server construction/migration service

[For WordPress only] Cloud server “Web Speed”

[For WordPress only] Cloud server “Web Speed”

[Cheap] Website security automatic diagnosis “Quick Scanner”

[Cheap] Website security automatic diagnosis “Quick Scanner”

[Reservation system development] EDISONE customization development service

[Reservation system development] EDISONE customization development service

[Registration of 100 URLs is 0 yen] Website monitoring service “Appmill”

[Registration of 100 URLs is 0 yen] Website monitoring service “Appmill”

[Compatible with over 200 countries] Global eSIM “Beyond SIM”

[Compatible with over 200 countries] Global eSIM “Beyond SIM”

[If you are traveling, business trip, or stationed in China] Chinese SIM service “Choco SIM”

[If you are traveling, business trip, or stationed in China] Chinese SIM service “Choco SIM”

[Global exclusive service] Beyond's MSP in North America and China

[Global exclusive service] Beyond's MSP in North America and China

[YouTube] Beyond official channel “Biyomaru Channel”

[YouTube] Beyond official channel “Biyomaru Channel”

[PHP new feature] PHP8 has been released

PHP

Hello, I'm Kashiwagi, a former ISMS manager at Beyond, a former programmer, and a current miscellaneous worker.
PHP8 was released in November 2020, and since it hasn't been mentioned yet on Beyond Blog, I'd like to introduce it here.

First, what is PHP?

without saying that it is a server-side scripting language.The
specifications and syntax are easy to understand, so the study cost is low and it is used in many places.
It has the advantage of being easy to connect to the database, so even beginners can implement it without hesitation.
Installation is also easy.

Install it on CentOS7 immediately

$ sudo yum -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm $ sudo yum -y install https://rpms.remirepo.net/enterprise/remi -release-7.rpm $ sudo yum -y install yum-utils $ sudo yum --enablerepo=remi-php80 install php

Since the installation should be completed, let's check the version.

$ php -v PHP 8.0.0 (cli) (built: Nov 24 2020 17:04:03) ( NTS gcc x86_64 ) Copyright (c) The PHP Group Zend Engine v4.0.0-dev, Copyright (c) Zend Technologies

It was installed successfully. Installation remains easy.

Try out new features right away

JIT

Processing will be faster. However, you may not be able to get that much benefit from web content.
Batch processing using PHP, which has been avoided until now, seems to be gaining momentum.
However, it seems that many people have explained JIT itself on blogs, etc., so I will not go into details.
I introduced it because it is a featured feature.

named argument

This is a new feature that allows you to pass arguments by name. This is already familiar in other languages ​​such as python.

// Named arguments function sample01( int $mae = 0, int $ato = 0 ) { var_dump( $mae ); var_dump( $ato ); } // You can specify which argument sample01( mae: 1, ato: 2 ); // Output result // int(1) // int(2) // You can do the opposite sample01( ato: 2, mae: 3 ); // Output result // int(3) // int( 2) // Only one can be used sample01( ato: 4 ); // Output result // int(0) // int(4)

match expression

This is a new feature that allows processing like a switch statement to be used like a ternary operator.

$x = 2; $sample02 = match ( $x ) { 1 => '$x is 1', 2 => '$x is 2', default => '$x is anything else', }; var_dump($ sample02); // Output result // string(8) "$x is 2"

I'm just introducing things that you can easily try out,
so I don't think there were any major changes to the specifications this time, but
I think there was a lot to see.


please be aware that there are some features and implementations that are not backward compatible when upgrading from PHP5 or PHP7, which remain in the world

We recommend that you consider upgrading by comparing the source you currently have with the official source.

If you found this article helpful , please give it a like!
1
Loading...
1 vote, average: 1.00 / 11
862
X facebook Hatena Bookmark pocket
[2025.6.30 Amazon Linux 2 support ended] Amazon Linux server migration solution

[2025.6.30 Amazon Linux 2 support ended] Amazon Linux server migration solution

The person who wrote this article

About the author

Hirofumi Kashiwagi

Like an engineer.

Date of joining: 2010/11/10
Career to date: 2 development companies
Current work: Engineer-like
Qualifications: AWS SAA, GCP PCA

I don't like Kashiwamochi that much.