New characteristics of PHP7 and carding of laravel common knowledge

Source: Internet
Author: User
Tags redis server

Due to the limited level of personal skills, the answer may be biased, please correct me.

PHP module
    • What are the differences between PHP7 and PHP5, and what are the new features?

      • Twice-fold performance improvement

      • Combining comparison operators (<=>)

      • Scalar type declaration

      • return type declaration

      • try...catchAdd multi-conditional judgment, more error errors can be handled with exception

      • Anonymous classes, now supported by the new class to instantiate an anonymous class, which can be used to replace some "burn after" the full class definition

      • ...... Learn more about the PHP7 new features link at the bottom of the article

    • Why does PHP7 have a better performance than PHP5?

      • Variable storage byte reduced, memory consumption reduced, variable operation speed increased

      • Improved array structure, array elements and hash mapping tables are allocated in the same piece of memory, reducing memory footprint and increasing CPU cache hit ratio

      • The mechanism of function invocation is improved, and some instructions are reduced to improve the efficiency of execution by optimizing the transfer of parameters.

Laravel Module
    • What is a service provider?

The service provider is the hub of all Laravel application boot launches, Laravel's core servers, registration service container bindings, event snooping, middleware, routing registrations, and our applications are booted by the service provider.

    • What is an IoC container?

The IoC (inversion of control) translates as "inversion of controls" and is also called "Dependency Injection" (DI). What is "inversion of control"? Object A functionality is dependent on object B, but control is controlled by object A, and control is reversed, so called "inversion of Control," and "Dependency injection" is the way to implement the IOC, which is to dynamically inject some kind of dependency into the object during the operation of the IOC container.

Its function is simply to use the method of dependency injection to decompose complex applications into mutually cooperative objects, so as to reduce the complexity of solving problems and realize the low coupling and high expansion of application code.

The service container in Laravel is a tool for managing dependency and execution dependency injection of classes.

    • What is facades?

Facades (a design pattern, usually translated as a façade mode) provides a "static" interface to access classes registered in the IoC container. Provides a simple, easy-to-remember syntax without remembering the long class names that must be injected or configured manually. In addition, the unique use of PHP dynamic methods makes it easy to test.

    • What is contract?

A contract (contract) is an interface that defines the core services provided by the Laravel framework. There is no essential difference between contract and facades, and its function is to make the interface low-coupling and simpler.

    • The principle of dependency injection?

This is not an explanation, it is the premise of understanding the IoC container.

    • What is Composer and how does it work?

Composer is a dependency management tool for PHP. It works by downloading the expanded packages that have been developed from the packagist.org composer repository to our applications and declaring dependencies and versioning.

Cache
    • What is the difference between Redis and memecached?

      • Redis supports richer types of data storage, String, Hash, List, set, and Sorted set. The Memcached supports only simple key-value structures.

      • Memcached Key-value Storage is more memory efficient than Redis uses a hash structure to make key-value storage.

      • Redis provides transactional functionality to guarantee the atomicity of a series of commands

      • Redis supports data persistence to keep in-memory data on disk

      • Redis uses only single cores, and Memcached can use multicore, so on average, Redis has a higher performance than Memcached for storing small data on each core.

    • How does Redis achieve persistence?

      • RDB persistence, which saves redis in-memory state to the hard disk, is equivalent to backing up the database state.

      • AOF Persistence (append-only-file), AOF persistence records the database by saving the write state of the Redis server lock execution. Equivalent to the command received by the backup database, all commands written to AOF are saved in the Redis protocol format.

Database
    • What is an index and what is the function? What are the common index types? How does Mysql build the indexing principle?

An index is a special file that contains a reference pointer to all the records in the data table, which is equivalent to a book's directory. Its role is to speed up the retrieval efficiency of data. Common index types have primary keys, unique indexes, composite indexes, and full-text indexes.

    • Principles of Index Creation

      • The leftmost prefix principle

      • Select a high-sensitivity column as an index

      • Expand the index as much as possible and do not create new indexes

    • How is high concurrency handled?

      • Using the cache

      • Optimize database and improve database usage efficiency

      • Load Balancing

PHP design mode is not much to say, but SOLID design principles are every phper must be mastered.

Other questions

The legacy also complements some of Phper's common noodle questions for the great gods.

    • How to design the sub-database table

    • How do I handle a MySQL deadlock?

    • Talk about your understanding of closures.

    • PHP Memory Recovery mechanism

    • How to troubleshoot PHP memory overflow issues

    • Methods of database Optimization

    • Brief introduction of operation Principle of Laravel

    • Laravel Routing Implementation principle

    • Cookie and session difference, where is the session saved on the server? How does the server obtain the client's cookie?

    • Server cluster building, load balancing, reverse proxy

    • Server Common Commands

New characteristics of PHP7 and carding of laravel common knowledge

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.