Jump to ratings and reviews
Rate this book

PHP Moderno: Novos recursos e boas práticas

Rate this book
O PHP está passando por um renascimento, embora possa ser difícil perceber, com tantos tutoriais PHP online desatualizados. Com este guia prático, você verá como o PHP se tornou uma linguagem cheia de recursos e madura, orientada a objetos, com namespaces e uma coleção crescente de bibliotecas de componentes reutilizáveis.
O autor Josh Lockhart - criador do 'PHP - The Right Way', uma iniciativa popular para incentivar as melhores práticas associadas ao PHP - mostra os recursos dessa nova linguagem em ação. Você conhecerá as melhores práticas para a arquitetura e o planejamento de aplicações, bancos de dados, segurança, testes, debugging e implantação.

- Conheça os recursos do PHP moderno como namespaces, traits, generators e closures;
- Descubra como encontrar, usar e criar componentes PHP; - Siga as melhores práticas para garantir a segurança das aplicações, trabalhar com bancos de dados, tratar erros e exceções e muito mais;
- Conheça ferramentas e técnicas para implantação, ajustes, testes e geração de perfil de suas aplicações PHP;
- Explore as implementações de HVVM e da linguagem Hack do Facebook - e como elas afetam o PHP moderno;
- Crie um ambiente local de desenvolvimento que seja muito parecido com seu servidor de produção.

296 pages, Paperback

First published January 25, 2015

88 people are currently reading
246 people want to read

About the author

Josh Lockhart

3 books4 followers

Ratings & Reviews

What do you think?
Rate this book

Friends & Following

Create a free account to discover what your friends think of this book!

Community Reviews

5 stars
101 (33%)
4 stars
146 (47%)
3 stars
49 (16%)
2 stars
5 (1%)
1 star
4 (1%)
Displaying 1 - 29 of 29 reviews
Profile Image for Evan Carroll.
6 reviews17 followers
September 18, 2016
I feel I am the ideal audience for this; the last book about PHP I read was on PHP4, as well as the last code base I worked on. A lot of the book feels wasted, and even more is questionably sound. That said, I did take away something from this book. I have no reason to doubt the author's intentions in writing it.

To talk about things I liked, Chapter 10 on Testing, the content on Filters, the mention of the Built in PHP Server, Date Handling, Component Set Up, and style-guide explanations which the author calls "Standards" (as if PHP didn't have more foundational things to worry about). All of this is generally a good read. More could be said, and it could probably be said better but you can learn something from this stuff.

It's not all roses this book has some issues,

Fluff: Hosting and Installation are entire fluff chapters. Numerous sections are just fluff too, such as "What are Components." (pg.52): the Author calls PHP Components "laser-focused" because, from his perspective, they're supposed to tackle a specific task. How does that make them any more "laser-focused" than CPAN packages or NPM packages? I'm confused by some of this wording. To make it more confusing, he tries to explain it right above where he labels PHP packages as "small" (it's an explained bullet point). There is no juxtaposition, "laser-focused" is presumably the reason why he thinks they're "small" and he wanted to more fluff. The whole section "What are Components" is pretty poor.

Unexplained things (pg.114): you'll see the word "bucket brigade" what the hell is that? It sounds like something the author invented, but it's not! It's actually a PHP term.

Security Confusion (pg.76): The whole section "Sanitize Input" is wrong. You *never* sanitize input going into a database. You always sanitize it coming out for the presentation medium. Even if the user submits a malicious script, what if you want to render it as text later -- outside of the HTML format? This is just goofy novice stuff to me. To his merit, the author also shows how to escape it on presentation. He agrees with me that you shouldn't double escape and says so explicitly on (pg.80). So why talk about escaping/sanitizing input, and then four pages later escaping output with a caveat that you should always escape output and never double escape?

Absent Modern Content: New features on PHP are mysteriously missing: there is no talk of spl.datastructures (which provide real arrays), spl.types, Judy Arrays. When it says Modern PHP, it assumes you're coming from PHP 5.x. There is no sufficient tutorials for me to be convinced that this would take you up from PHP 4.x. At some point, you may have to "relearn" a whole language. This book may supplement a PHP 5.x user's skill set, but you'll have to look elsewhere if you're not up with 5.x yet.

PHP Gotchas & Author Enchantment: PHP is absolutely notorious for requiring language experts to know what not to do, and the gotchas. Professionally, I code in most dynamic languages that host major web projects. Without talking about new arrays, what about the drawbacks of old PHP "arrays"? More and more I feel O'Reilly books are written as marketing text for the language, or for the author's resume. If you don't talk about what sucks in the language and you're not writing to a beginner audience then you're not doing your job. People that read your book have to know where the warts are. This is not sufficiently covered. I think Josh's expertise was too confined to PHP. He's too used to the warts to sufficiently communicate the warts, so they're absent in this book.
Profile Image for Shaher Jamal Eddin.
32 reviews1 follower
January 16, 2016
I recommend this book for a person who is done with basics/foundation of PHP and yet confused with:
1- What the online communities/forums discussions are all about.
2-The advanced techniques of PHP (codes example... etc.)
As this book will give the reader a direct explanation about the different aspects of the new development practices and put them all together (provides a simplified version of the big picture). Moreover I found the writer's way of explaining understandable and reader-friendly!. and by the way the code examples are super useful and easy to implement in your own applications.

Cheers!

5 reviews9 followers
December 21, 2015
إن كنت ماتزال عالقا في “ العهد القديم “ من البرمجة - إن صحّت التسمية - فهذا الكتاب يناسبك.

يستعرض الكتاب أهم الخصائص التي أضيفت إلى بي إتش بي مؤخرا، تحديدا ما بعد الإصدار 5.3، ثم يحدثك عن ثورة المعايير وكيف كانت سببا في تطور برمجيات ومجتمع البي إتش بي.

بعد الانتهاء من قراءة الكتاب، ستكون لديك المعرفة الكافية لبناء برامج باستخدام العناصر/المكونات المطورة من قِبل مبرمجين آخرين، وكذلك بناء وتطوير عناصرك/مكوناتك الخاصة، بمعنى آخر، ستخرج من قفص التفكير داخل حدود “ فريمورك “ ما.

الكتاب مختصر، ستحتاج في بعض الأحيان إلى الإطلاع على مصادر أخرى للاستزادة.
Profile Image for Shijia.
2 reviews
Read
March 9, 2021
Revealing a modernized PHP world, this fantastic book has greatly broadened my horizon.

To my surprise, this book is quite easy to understand as long as you know a bit of PHP. Descriptions are always accompanied by sample code, which I found extremely useful.

Despite sharing the newest syntax and components, it has demonstrated how modern tools like composer (as package manager) and more could simplify our development process. Testing, deploying and further tips are also introduced as essential skills of a good PHP coder.

If you are an intermediate or even a beginner of PHP, I strongly recommend you to read it in order to stay up-to-date with the latest and the best part of PHP.
Profile Image for David.
7 reviews1 follower
February 22, 2016
a fantastic book, highly recommend it for anyone wanting to get up to speed with recent changes, tools and practices. It's really useful for programmers who have been programming for some time but not keeping up to date.
Profile Image for José Moreira.
12 reviews
March 5, 2019
Kind of superficial on some topics and excessive installation guides. Was expecting a more advanced book.
229 reviews5 followers
October 11, 2020
Slightly dated but very nice short recipes / advice collection book.
Profile Image for atom_box Evan G.
245 reviews5 followers
November 15, 2020
Read this in 2020. For me, coming from another language, half of what makes PHP cool is in PHP 5 so I learned a ton from Modern PHP. This Lockhart book is from 2015 so it gives all of the PHP 5 things, like namespaces, traits, interfaces, and generators. And then it actually goes into types from PHP 7 (which hadn't been released yet). There's a "Looking Ahead" Chapter (12) that tells the story of Facebook building the PHP we have today, including the Hip Hop Virtual Machine and its C++ compilation tricks that make PHP run so friggin fast.

My other, more syntax-heavy book is PHP 7 by David Powers but if I had to choose just one, it would be this book here by Josh Lockhart. Modern PHP is the book that is fun to read and made me a better programmer. Lockhart maintains the phptherightway.com site.
Profile Image for AJ Michels.
3 reviews
December 27, 2017
Overall I think this was a good book with lots of useful information for a particular audience. Unfortunately I discovered I am not part of that audience. There was no new information in this book for me. If you have experience with PHP but have been away from it for the past 5 years or if you have been stuck working on old code and for some reason haven’t been investing in your career, you should check out this book.
Profile Image for Will Hines.
Author 6 books87 followers
January 7, 2018
Content is terrific: modern, practical. The Features and Good Practices chapters are so valuable. Writing is a little verbose. Caught me up on several things I did not know about: traits, composer, autoloading.
Profile Image for Philip.
31 reviews
May 18, 2017
Great book! Highly recommend for any aspiring PHP developer.
11 reviews
October 28, 2019
Excellent book for a php developer, highly recommend it.
Profile Image for Lucas Ribeiro.
15 reviews
April 12, 2023
The concepts and ideas are pretty nice, turns you into a better developer for sure, but take care it's outdated.
Profile Image for Axel.
2 reviews2 followers
October 17, 2016
Excellent "talk" about the new momentum that is gaining PHP and the PHP Community. Great starting point (getting deep insight into this many topics the book covers would need a book of 1000+ pages) for all things related to PHP development and the "modernization" that is thriving around PHP.
Profile Image for Eva 'Nomad' .
83 reviews20 followers
January 6, 2017
If you are looking to start with PHP or deepen your knowledge, this is not a book for you.

If you have been sleeping under a rock during the last 5 years and want to know what is new and exciting in PHP, compare notes about good practices or read some tutorials, that you can otherwise find on the Internet - go ahead!.

My version of the book is of 2015 and does not include much about PHP 7.0.

3.5/5
Profile Image for Aleksej.
59 reviews
September 3, 2015
The main audience of this book are programmers with one or two years of experience who stuck in the PHP 5.3 era and want to learn something new. Actually, it's not all about new features in PHP, but it was the really first BOOK I've read about PSR, hhvm and Composer. Hope there will be the second edition with php7/ZE3 features.
Profile Image for Camilo.
86 reviews2 followers
November 4, 2015
I kind of already knew a lot of the stuff in it, so I didn't get as much out of it as I wanted. If I'd picked it up before I went to a few SunshinePHP conferences, though, it would have melted my brain. If you're a PHP dev in the procedural PHP world or making the same old wordpress theme again and again, pick it up and catch up quickly with this book.
Profile Image for Muhammad Hakim Asy'ari.
40 reviews4 followers
July 9, 2015
not book php as language per se, it quite refreshing my knowledge about current php (component, composer, PHP-FiG, PHP PSR, best practices, etc), after not involve with php based project since a decade a go.

oh by the way, I read 2nd edition
379 reviews10 followers
September 22, 2015
Ottimo manuale per capire come è cambiato il mondo PHP negli ultimi 4-5 anni, e soprattutto per aggiornarsi ai nuovi strumenti.

L'unico difetto è forse che non scende troppo nei dettagli, ma molti degli argomenti richiederebbero un manuale a parte per ognuno.
Profile Image for Juancarlos.
1 review
January 8, 2016
It's a good introduction to modern techniques, obviously is not a deep compendium, but offers a really good introduction to all the aspects about the PHP World nowadays.
Totally recommended for beginners.
1 review
May 25, 2015
Great overview of the modern PHP practices. It points you to what you should be learning and using, and gives you a brief but useful introduction to the topics.
Profile Image for Jim.
20 reviews2 followers
May 14, 2016
Good intro to stuff like Composer and PSR and basic toolsets. If you don't know what those are or don't understand them, this is for you. If you do, you don't need this book.
Displaying 1 - 29 of 29 reviews

Can't find what you're looking for?

Get help and learn more about the design.