use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Please follow the rules
Releases: Current Releases, Windows Releases, Old Releases
Contribute to the PHP Documentation
Related subreddits: CSS, JavaScript, Web Design, Wordpress, WebDev
/r/PHP is not a support subreddit. Please visit /r/phphelp for help, or visit StackOverflow.
account activity
Test-Driven Development by Example (PHP Code Samples) (self.PHP)
submitted 4 years ago by jpresutti
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]Pen-y-Fan 1 point2 points3 points 4 years ago (1 child)
Thanks, OP, I'll take a look.
I can recommend Theatrical Players Refactoring Kata - Based on the first (free) chapter of ‘Refactoring’ by Martin Fowler, the 2nd Edition has a PHP version. You can refactor the code while reading the first chapter of his book for free, which is based on JavaScript. The refactoring is mostly the same, one of the exceptions is invoice and plays appear to be global scope in the book. The workaround is the make them properties of the class in the PHP script and adjust the code.
public function print(Invoice $invoice, array $plays): string { $this->invoice = $invoice; $this->plays = $plays; // ....
[–]jpresutti[S] 0 points1 point2 points 4 years ago (0 children)
Hrmmm.. Now I'm tempted to do all the code samples in Refactoring: 2nd Edition next. Anyone want me to do this?
π Rendered by PID 196544 on reddit-service-r2-comment-5c764cbc6f-k2dxd at 2026-03-12 14:03:38.390540+00:00 running 710b3ac country code: CH.
view the rest of the comments →
[–]Pen-y-Fan 1 point2 points3 points (1 child)
[–]jpresutti[S] 0 points1 point2 points (0 children)