diff --git a/_posts/03-02-01-Programming-Paradigms.md b/_posts/03-02-01-Programming-Paradigms.md index bc7c486..945a3f7 100644 --- a/_posts/03-02-01-Programming-Paradigms.md +++ b/_posts/03-02-01-Programming-Paradigms.md @@ -23,7 +23,7 @@ PHP supports first-class function, meaning that a function can be assigned to a functions can be referenced by a variable and invoked dynamically. Functions can be passed as arguments to other functions (feature called Higher-order functions) and function can return other functions. -Recursion, a feature that allows a function to call itself is supported by the language, but most of the PHP code focus +Recursion, a feature that allows a function to call itself, is supported by the language, but most of the PHP code focus on iteration. New anonymous functions (with support for closures) are present since PHP 5.3 (2009). diff --git a/_posts/07-01-01-Databases.md b/_posts/07-01-01-Databases.md index 4c23995..7d16f2a 100644 --- a/_posts/07-01-01-Databases.md +++ b/_posts/07-01-01-Databases.md @@ -38,7 +38,7 @@ $statement = $pdo->query("SELECT some\_field FROM some\_table"); $row = $statement->fetch(PDO::FETCH_ASSOC); echo htmlentities($row['some_field']); -// PDO + MySQL +// PDO + SQLite $pdo = new PDO('sqlite:/path/db/foo.sqlite'); $statement = $pdo->query("SELECT some\_field FROM some\_table"); $row = $statement->fetch(PDO::FETCH_ASSOC); diff --git a/_posts/08-02-01-Errors.md b/_posts/08-02-01-Errors.md index be359e1..ea2f771 100644 --- a/_posts/08-02-01-Errors.md +++ b/_posts/08-02-01-Errors.md @@ -72,7 +72,7 @@ This will output `$foo['bar']` if it exists, but will simply return a null and p This might seem like a good idea, but there are a few undesirable tradeoffs. PHP handles expressions using an `@` in a less performant way than expressions without an `@`. Premature optimization may be the root of all programming arguments, but if performance is particularly important for your application/library it's important to understand the error control operator's performance implications. -Secondly, the error control operator **completely** swallows the error. The error is not displayed, and the error is not send to the error log. Also, stock/production PHP systems have no way to turn off the error control operator. While you may be correct that the error you're seeing is harmless, a different, less harmless error will be just as silent. +Secondly, the error control operator **completely** swallows the error. The error is not displayed, and the error is not sent to the error log. Also, stock/production PHP systems have no way to turn off the error control operator. While you may be correct that the error you're seeing is harmless, a different, less harmless error will be just as silent. If there's a way to avoid the error suppression operator, you should consider it. For example, our code above could be rewritten like this diff --git a/_posts/13-04-01-Books.md b/_posts/13-04-01-Books.md index 372dd86..5282009 100644 --- a/_posts/13-04-01-Books.md +++ b/_posts/13-04-01-Books.md @@ -22,3 +22,8 @@ available as a book completely for free * [Modernizing Legacy Applications In PHP](https://leanpub.com/mlaphp) - Get your code under control in a series of small, specific steps +* [Building Secure PHP Apps](https://leanpub.com/buildingsecurephpapps) - Learn the security basics that a senior developer usually acquires over years of experience, all condensed down into one quick and easy handbook +* [The Grumpy Programmer's Guide To Building Testable PHP Applications](https://leanpub.com/grumpy-testing) - Learning to write testable doesn't have to suck +* [Securing PHP: Core Concepts](https://leanpub.com/securingphp-coreconcepts) - A guide to some of the most common security terms and provides some examples of them in every day PHP +* [Scaling PHP](https://leanpub.com/scalingphp) - Stop playing sysadmin and get back to coding +* [Signaling PHP](https://leanpub.com/signalingphp) - PCNLT signals are a great help when writing PHP scripts that run from the command line. diff --git a/index.html b/index.html index 54bd0cd..5fdb78f 100644 --- a/index.html +++ b/index.html @@ -6,7 +6,7 @@ description: "An easy-to-read, quick reference for PHP best practices, accepted {% capture welcome_content %}{% include welcome.md %}{% endcapture %} {{ welcome_content|markdownify }} -{% capture backtotop %}[Back to Top](#top){.top}{% endcapture %} +{% capture backtotop %}[Back to Top](#top){:.top}{% endcapture %} {% for post in site.posts reversed %} {% if post.isChild != true and loop.first != true %} {{ backtotop|markdownify }}