Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Reddit.com:
Whats the most weirdest program you have written with PHP?
Jul 06, 2018 @ 15:12:05

Sometimes it's just fun to talk about all of the odd things we've done with PHP in the past. In this thread on /r/php on Reddit, developers have shared some of the "weirdest programs" they've created with the language. Here's just a sampling:

  • a script which automatically wish for friend's birthday on midnight in facebook using Graph API
  • a page counter
  • a video watermarking and streaming tool
  • a counter-bot script for preventing bot spam accounts in a game
  • generate Flash SWF files
  • a pulling an image from a webcam for a "real-time" Facebook cover photo
  • solving quadratic equations for homework
  • a "cat fax" service
  • a Quake game browser

There's many, many, many more in the full post and it's interesting to see what all other developers have done. Head on over and share your weirdest PHP scripts too!

tagged: reddit weird script community feedback

Link: https://www.reddit.com/r/PHP/comments/8ufxp2/whats_the_most_weirdest_program_you_have_written/

SitePoint PHP Blog:
Taming the Snoo: Playing with the Reddit API
Feb 14, 2017 @ 17:56:58

The SitePoint PHP blog has a new tutorial posted by author Claudio Ribeiro looking at how to "tame the snoo" - using PHP to work with the Reddit API via an OAuth application.

Reddit is a social networking, entertainment, and news website where the content is almost exclusively submitted by users.

[...] Reddit also offers its own API. This way, we can use all the information available on Reddit to enrich our own websites or build our own Reddit clients. In this article, we will tackle some basic Reddit API usage with PHP.

The tutorial starts with a brief overview of the Reddit API and the functionality they're focusing on: the "search" method. Example URLs are included showing the searching of terms, pagination options, sorting and other restrictions. They then bring PHP into the mix, using the Guzzle HTTP library to create a basic "Searcher" class. They also use the Twig templating system to output the results (simple template included). Finally they show how to make the OAuth application on your Reddit account, pull in the "adoy/oauth2" package and the code to connect your service via OAuth to the Reddit API.

tagged: snoo reddit api tutorial guzzle twig search

Link: https://www.sitepoint.com/taming-the-snoo-playing-with-the-reddit-api/

Reddit.com:
How is everyone doing development locally today?
Sep 23, 2016 @ 17:08:17

On the /r/php subreddit from Reddit.com there's a post from Spvrtan asking the community what technologies they're using for local development in their day to day development work.

It's honestly been over 5 years since I last touched PHP on the back-end. At that time, other than "doing it live", XAMPP was the top dog for local environments. Is there a new player in the space or should I go with the same? I've been working primarily as a front-end engineer for the past few years during my full-time employment roles and touched the back-end on projects I've worked on but they've all been Java-based.

They also ask what other developers are using for their deployment tools and pipelines. Answers to the post so far include some of the usual tools and methods including:

  • Docker
  • puphpet (for use with Vagrant)
  • Homestead from Laravel

Other comments also mention the manual creation of virtual machines and even support for local installations rather than virtual ones. What's your development environment like? Head over to the topic and share your own setup too.

tagged: reddit rphp local development virtualmachine opinion deployment

Link: https://www.reddit.com/r/PHP/comments/54487o/how_is_everyone_doing_development_locally_today

Reddit.com:
Why experienced developers consider Laravel as a poorly designed framework?
Jul 03, 2015 @ 16:41:03

There's a huge thread that's been going on over in the /r/php subreddit on Reddit.com with opinions on why experienced developers consider Laravel as a poorly designed framework.

I have been developing in Laravel and I loved it. My work colleagues that have been developing for over 10 years (I have 2 years experience) say that Laravel is maybe fast to develop and easy to understand but its only because it is poorly designed. He is strongly Symfony orientated and as per his instructions for past couple of months I have been learning Symfony and I have just finished a deployment of my first website. I miss Laravel ways so much.

Currently there's over 200 responses to the question with a wide range of opinions, everything from support of Laravel and its ways to the other side supporting Symfony and its structure. As is par for the course, there's also a share of "troll" comments in the mix, so be sure as you're reading through them to weed those out. There's also some interesting and enlightening things about Laravel, its structure and what it has to offer that those that may not be familiar with it could learn.

tagged: reddit rphp experienced developer laravel poorly designed framework opinion

Link: https://www.reddit.com/r/PHP/comments/3bmclk/why_experienced_developers_consider_laravel_as_a/

Reddit.com:
I feel like events are an anti-pattern
May 06, 2015 @ 15:55:00

On the /r/php subreddit frm Reddit.com, phpdevster proposes an interesting opinion - that an event system, set up with a listener and defined events, has become more of an anti-pattern in its most common implementation.

If events are only meant to be additional functionality that ALWAYS ALWAY ALWAYS should happen after a primary action is taken, how often is code really that absolute? Why are events not implemented in more flexible ways by frameworks? - that is implementing some inversion of control which would allow callers to determine which listeners would be relevant to the given context.

He illustrates his point with an example user registration system that fires a "user-was-registered" event that, in turn, fires off a series of events via a listener. He points out a pretty large flaw, though. While the functionality involved in the event is decoupled (the event itself), the behaviors defined by that event are not. Comments on the post offer some different options and solutions to the same problem including:

  • Further decoupling of the eventing process
  • Using objects with settable properties rather than just event name strings
  • The idea of using an "event store" to handle decoupling rather than more immediate code-based solutions

Have some thoughts of your own on events and decoupling? Go over and share them too.

tagged: event antipattern designpattern reddit opinion comments

Link: http://www.reddit.com/r/PHP/comments/34zp6j/i_feel_like_events_are_an_antipattern/

Reddit.com:
Frameworks, how are requests per second important?
Apr 03, 2015 @ 15:37:50

In this recent post to the /r/php subreddit on Reddit.com, AfterNite wonders why it's important to measure the "requests per second" that a framework handles (or if it is at all).

I have been using Laravel 4 for a while now. Recently I saw a benchmark here (http://blog.a-way-out.net/blog/2015/03/27/php-framework-benchmark/). There are many frameworks that were compared and compared to phalcon the requests per second seem crappy. Hearing that zend is powerful and primarily aimed at businesses how is it that a few hundred requests per second is good? I can't wrap my head around why people are using frameworks such as Zend, Laravel 5 and Symfony.

The comments on the post mention things like:

  • taking benchmarks "with a grain of salt"
  • How it relates to optimization
  • Wondering what the mean requests-per-second would be
  • What effect a datasource has on performance
  • The relation between performance and ease of use

You can read the full post or leave an opinion of your own on the full post.

tagged: requestspersecond performance optimization framework opinion reddit

Link: http://www.reddit.com/r/PHP/comments/313nc8/frameworks_how_are_requests_per_second_important/

Reddit.com:
So, what is PHP's nature? Anyone actually know exactly what it is?
Feb 13, 2015 @ 17:58:01

In this recent post to the /r/php subreddit on Reddit.com, the question is asked "what is the nature of PHP?" and how it relates to what features make it into the language and which don't.

I've heard many times that a proposed RFC/new feature got rejected by PHP internals in voting phase, since 'it does not fit the nature of PHP'. But the question is, what is PHP's nature? Does it even have a nature at all? If yes, is there a standard or guideline of what fits in PHP's nature? I think its very confusing, isnt it? Anyone actually have some insights in this?

In the comments other users provide a wide range of opinions including:

  • "I would recommend taking those types of comments with a grain of salt. PHP's nature is a very subjective topic, as you can tell by the other comments."
  • "PHP was made to make dynamic web pages at a time when webpages contained minimal dynamic content. It was made at a time when web pages doesn't required a programming language to generate."
  • "Easy to pick up and make a website for weak devs/prototypes (easy to abuse). Much of the hate for PHP is because this abuse is possible and exploited often."
  • "As someone mentioned, nobody who does any sort of web development today can ignore Javascript and they will typically be switching back and forth between Javascript and PHP every couple of minutes. This is our target user these days and as such this syntax is appropriate I think."

Check out the full post for more opinions or to voice your own!

tagged: nature language opinion reddit

Link: http://www.reddit.com/r/PHP/comments/2vmh3o/so_what_is_phps_nature_anyone_actually_know/

Reddit.com:
What changes would you like to see in PHP 7?
Jan 20, 2015 @ 18:51:08

In the /r/php subreddit on Reddit.com a question was posed to the community: What changes would you like to see in PHP 7?. So far there's 80+ answers with a wide variety of responses.

As well as massive performance improvements, PHP 7's change / feature list is already looking great. You can find most of the features that have been accepted or are under discussion on the PHP Dev Wiki: RFCs section. But what changes would make a difference to you? What would you really like to see make it in (already suggested or a new suggestion)?

Here's just a few of the suggestions made by fellow Reddit users:

  • fixing inconsistencies in naming
  • sandboxed eval
  • a complete rework of the standard library
  • the introduction of generics
  • adding enum functionality
  • type aliasing
  • stack traces for fatal errors

Check out the full post for more ideas and feedback from other members of the community too. It's an interesting list of suggestions, some that are even already in the works.

tagged: php7 changes reddit opinion community language feature improvement

Link: http://www.reddit.com/r/PHP/comments/2sx5x3/what_changes_would_you_like_to_see_in_php_7/

Reddit.com:
The purpose of a framework
Sep 19, 2014 @ 17:19:48

In this post over in the /r/PHP community of Reddit.com, there's a question about frameworks. The original poster wonders about the purpose of a framework and if they're a requirement to build any kind of application that's "worthwhile".

I read posts here from time to time, and Laravel and Symphony are mentioned a lot here, and I always get the impression that it is a must to use a framework, to build something worthwhile. A little background on myself is that I've always approached development in a cowboy coding style where I just code. I've made a system where I use the basic mysqli object in PHP for database interaction, and I use Smarty templating system to output the html/css/js. I build my own classes based on what the customer is asking for, and then obviously I make the controller pages calling the classes I made - manipulate the data and output to smarty. What would Symphony help me with - that would be hard to accomplish regularly?

Plenty of answers and opinions are shared in the comments of the post, ranging from:

  • Encouragement for Symfony2 and the development speed it accommodates
  • Building a project without a framework
  • The benefits and downfalls of using MVC and other design patterns you may not fully understand
  • A definition of what a "framework" means outside of the world of MVC

There's also a consensus among several of the posts that one of the major benefits of a framework is to provide an overall decrease in the time to market with the handy features and things it provides out of the box. What do you think? Head over and post some thoughts of your own about frameworks and where they fit in your development.

tagged: framework purpose opinion reddit mvc

Link: http://www.reddit.com/r/PHP/comments/2gub3p/the_purpose_of_a_framework/

Reddit.com:
PHP devs -What are your 'must have' tools and apps?
Jun 23, 2014 @ 17:54:45

If you're a PHP developer and are looking for some new tools to "up your game" and improve your development life, check out this new post to /r/php on Reddit.com. Developers of all kinds have shared tools they've found useful in their own development (and maybe you can too).

In other words, what tools make your development life easier and why? Can be anything from database design to FTP clients to workflow planners. Which tools can you just not live without?

Among the many tools on the list are things like:

  • PHP CodeSniffer
  • PHPUnit
  • IDEs like PHPStorm, Netbeans and editors like Sublime Text
  • Git
  • Composer
  • Vagrant/VirtualBox
  • Xdebug
  • Redis
  • Behat

Check out the full post for the complete (and growing) list.

tagged: musthave tools applications opinion reddit

Link: http://www.reddit.com/r/PHP/comments/28r11n/php_devs_what_are_your_must_have_tools_and_apps/


Trending Topics: