PHP 8 Programming Tips, Tricks and Best Practices

BIRMINGHAM—MUMBAI

PHP 8 Programming Tips, Tricks and Best Practices

Copyright © 2021 Packt Publishing

All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.

Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publishing or its dealers and distributors, will be held liable for any damages caused or alleged to have been caused directly or indirectly by this book.

Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.

Group Product Managers: Richa Tripathi

Publishing Product Manager: Sathyanarayanan Ellapulli

Senior Editor: Storm Mann

Content Development Editor: Nithya Sadanandan

Technical Editor: Pradeep Sahu

Copy Editor: Safis Editing

Project Coordinator: Deeksha Thakkar

Proofreader: Safis Editing

Indexer: Vinayak Purushotham

Production Designer: Jyoti Chauhan

First published: July 2021

Production reference: 1280721

Published by Packt Publishing Ltd.

Livery Place

35 Livery Street

Birmingham

B3 2PB, UK.

ISBN 978-1-80107-187-1

www.packt.com

Foreword

I've known Doug Bierer for many years now. It has been my great privilege to work with him on training new PHP developers and helping existing ones to grow their skills. I have even had the distinct privilege of butchering the pronunciation of his name many times. Through the years, though, I've come to respect Doug's ability to take technical concepts and put them in a language that just about anyone can understand. That's why when he wrote and asked me whether I would write the foreword for this book, I was excited to say yes.

Technical training is not easy. Not only does a trainer have to have a thorough understanding of the topic being discussed, but they also have to have the ability to convey ideas and concepts to others in clear language. I've spent a large part of my career struggling with how to best combine these two unrelated skills. Doug makes it look easy and this book is just the latest proof of that. From the language used to the examples given, everything is clearly laid out for you.

PHP 8 is a huge leap forward. Even as we write about PHP 8.0, PHP 8.1 is in the alpha stages of testing, and the tools and concepts embodied in PHP today are as good as they are in any language built for web development. When you add the speed increases that we have enjoyed with each new version for the past few years, you can begin to see why PHP is still a powerhouse of web development.

By purchasing this book, you are taking the first step in being able to harness the power of PHP 8 in your own projects. When you combine the knowledge you will gain from this book and Doug's skill at making the concepts understandable and immediately applicable to your problems, you will have lit the fuse on a rocket that will propel your skills and your career to new heights.

Strap in and hold on – this is going to be a fun ride!

Cal Evans ([email protected])

Senior Consultant, EICC, Inc.

Contributors

About the author

Doug Bierer has been hooked on computers since his first program, written on a DEC PDP-8, in 1971. In his wide-ranging career, he has been a professional contract programmer since 1978, having written applications in BASIC, PL/I, Assembler, FORTH, C, C++, dBase/FoxBase/Clipper, Pascal, Perl, Java, and PHP. He deployed his first website in 1993 while living in San Francisco. He speaks four languages, has traveled extensively, and now resides in Thailand. He also spent some years doing system administration and TCP/IP networking. Some of his technical works include PHP 7 Programming Cookbook and Learning MongoDB 4.x (Packt), as well as Learning PHP and MySQL, Learning PHP Security, and Learning Doctrine (O'Reilly Media).

About the reviewer

Matthew Setter is a highly skilled senior backend software engineer, specializing in PHP and web-based applications, with 20 years' experience. Matthew has worked for small start-ups, in academia, and for Fortune 500 companies.

He has worked on PHP, Go, Bash, TDD and BDD, MySQL, PostgreSQL, MSSQL Server, HTML5, CSS, JavaScript, Docker, Git, Slim, Laminas, Mezzio, Zend Expressive, Zend Framework, Laravel, PHPUnit, Codeception, GoConvey, JUnit, Pico, Nano, Vim, Alpine Linux, Debian, Linux Mint, Ubuntu, Apache, NGINX, ufw, and iptables, with a focus on Laminas/Mezzio and Linux.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.134.102.182