PHP

  • Benford's law in frameworks
    Dec 9, 2015 ·

    In a new talk I’m currently presenting at conferences and meetups, I talk - amongst other things - about Benford’s law. This law states that in natural occurring numbers, the first digit …

    Read more →
  • Incrementing values in PHP
    Oct 13, 2015 ·

    Take a variable, increment it with 1. That sounds like a simple enough job right? Well.. from a PHP developer point of view that might seem the case, but is it really? There are bound to be some …

    Read more →
  • Advanced user switching
    Feb 24, 2015 ·

    A really neat trick in the Symfony Security component is the fact that you can impersonate or “switch” users. This allows you to login as another user, without supplying their password. …

    Read more →
  • Debugging Symfony components
    Dec 31, 2014 ·

    Don’t you hate it when you are stepping through your debugger during a Symfony application debug session, and all of a sudden it cannot find files anymore as Symfony uses code located in the …

    Read more →
  • Deepdive into the symfony2 security component: part 1
    Oct 19, 2014 ·

    Once in a while I like diving into code and see how things work under the hood. And as the symfony2 framework consists of many different components, bundles and bridges, there is a lot to discover. …

    Read more →
  • Internal PHP function usage
    Jul 25, 2014

    How many internal PHP functions (things like count(), strpos(), array_merge() etc), does PHP have? Depending on which version you use, and how many extensions you have loaded, somewhere between 1000 …

    Read more →
  • Throttle your API calls: RateLimitBundle
    May 28, 2014 ·

    A web application is not complete without an API nowadays. APIs allow third parties - or just end users - to use the data from the platform for whatever they want. But by allowing applications to make …

    Read more →
  • Dynamic form modification in Symfony2
    Mar 19, 2014 ·

    Sometimes (or actually, a lot of the time), handling forms will go beyond the basics. And even though Symfony2 gives you out-of-the-box a really clean way of creating forms, it sometimes just …

    Read more →
  • SPL Deepdive: RegexIterator
    Feb 12, 2014 ·

    If everything goes according to plan (which never is the case), I’ll try and highlight some of the fascinating stuff that can be found inside the SPL. I do a lot of presentations about the SPL, …

    Read more →
  • Realtime PHPUnit
    Feb 2, 2014 ·

    Not all IDEs (actually, i haven’t seen even one IDE that does this), can run your unit-tests as soon as something changes.

    Read more →
  • Decoding TLS with PHP.
    Dec 30, 2013 ·

    As a proof of concept I wanted to see in how far I could decode some TLS data on the client side. Obviously, this is very complex matter, and even though TLS looks deceptively simple, it isn’t. …

    Read more →
  • External code coverage with travis / scrutinizer
    Nov 20, 2013 ·

    I really love the travis-ci and scrutinizer-ci combo. Between them there are not many things missing like you would find in more complex systems like Jenkins for instance. Both travis and scrutinizer …

    Read more →
  • PHP's Resources and garbage collection
    Jul 10, 2013 ·

    Today, I’ve found a nice bug/feature/whatsmathing in PHP. I was playing around with writing a daemon and if you have any experience writing daemons (in any language), there are a few rules you …

    Read more →
  • PHP5.5: Try/Catch/Finally
    Feb 12, 2013 ·

    Exception handling is available in PHP since version 5. It allows you to have a more fine-grained control over code when things go wrong ie, when exceptions occur. But since PHP 5.5, exception …

    Read more →
  • Custom symfony2 config loader
    Jan 30, 2013 ·

    It happens more and more: large projects where your symfony2 site is just a small part in the big picture. Lots of additional components might even play a bigger part, especially when you are dealing …

    Read more →
  • MultiParamConverter for Symfony2
    Aug 4, 2012 ·

    If you know Symfony2, you probably are using (or at least, have heard of) the @paramConverter annotation from the SensioFrameworkExtraBundle. This is a really simple way to convert slugs into …

    Read more →
  • Symfony2: Implementing ACL rules in your Data Fixtures
    Jul 4, 2012 ·

    Doctrine’s DataFixtures are a great way to add test data to your application. It’s fairly easy to get this going: Create a fixureLoader that extends …

    Read more →
  • SPL: Using the iteratorAggregate interface
    Dec 4, 2011 ·

    The SPL is one of hardest things to grasp for most PHP developers. But why is this? The lack of documentation inside the manual, the fact that there are not many real-life examples, or maybe …

    Read more →
  • Public key encryption on php|architect
    Mar 1, 2011 ·

    Yesterday the February edition of php|architect came out. I always look forward upon the new release every month, but even more so this month since it features an article about “Public Key …

    Read more →
  • Talking at the PHP Benelux 2011
    Jan 23, 2011 ·

    As you might know, the PHPBenelux Conference 2011 is right around the corner. Happy to inform you that not only will I attend, but also will be speaking at this event. My talk will be about the …

    Read more →
  • Using syslog for your php applications
    Jan 12, 2011 ·

    Linux, and other unices have an excellent system to centralize log events. This is done through syslog. This system removes the need for every application to maintain their own log files and let the …

    Read more →
  • PHP 5.4: RegexIterator::getRegex()
    Jan 6, 2011 ·

    Recently, my colleague Jeroen van Dijk needed to extend (or better yet: override) the accept()* method for the RegexIterator. Turns out this wasn’t as easy as it might sound in practice. So …

    Read more →
  • Enrise: Appending the appenditerator
    Dec 26, 2010 ·

    I’ve posted a blog at the @enrise techblog about enhancing SPL’s appenditerator. This lovely iterator can be useful from time to time but it does not always do what you need. Here’s …

    Read more →
  • OAuth timestamps and nonces
    Dec 16, 2010 ·

    Oauth is a very popular authentication mechanism used for a lot of web applications. And not without good reasons. It is relatively easy to implement, has different flavours (2-legged, 3-legged …

    Read more →
  • PHP srand problems with suhosin
    Dec 13, 2010 ·

    Today I stumbled across an odd problem which took me about an hour to figure out what was going on. It had to do with mt_srand(), where it looked like it didn’t work properly. I needed a …

    Read more →
  • Encryption operating modes: ECB vs CBC
    Dec 8, 2010 ·

    Today I overheard two colleagues discussing one of my favorite subjects: encryption. The discussion was about that encrypting data (with a normal block cipher) was working perfectly in ECB mode, but …

    Read more →
  • Top-5 certifications for every PHP programmer
    Dec 3, 2010 ·

    Today I’ve passed the Zend Framework Certification exam and with that I can finally close my new years resolution for 2010: doing 12 (tech related) exams in 2010. So I’ve seen a lot of …

    Read more →
  • 10 advanced linux command line tools
    Nov 24, 2010 ·

    Most developers who are working at the command line on a Linux system know the “basic” commands: ls, cd, cat, tail, head, sort, grep, find and others. More “advanced” users …

    Read more →
  • Centralising your tools in a custom repository - Part 1
    Nov 22, 2010 ·

    At almost every software company I’ve been involved in, used custom-made tools for various tasks. These tools range from simple shell-scripts for search&replacing data to large …

    Read more →
  • Centralising your tools in a custom repository – Part 2
    Nov 22, 2010 ·

    During this blog post I will talk about creating your own custom package repository. However, before you can setup a repository, you need packages. This previous post talks about setting up your …

    Read more →
  • Testing encoders for PHP
    Aug 14, 2010 ·

    A friend of mine posted a tweet about problems with Zend Guard just the other day. My friendly advise was: try using another encoder. Which he kindly ignored :) Which on my turn again made me wonder: …

    Read more →
  • Creating a traceroute program in PHP
    Jul 30, 2010 ·

    Today i was reading upon this wonderful article about writing a trace-route program in Python in 40 lines. Even though trace-route is one of the many tools i use on day to day basis, i never really …

    Read more →
  • Minimizing cache stampedes
    Jul 29, 2010 ·

    Caching is THE magic solution when it comes to optimizing your web applications. There are a lot of caching strategies and applications outthere. Some prefer MySQL query caching, others use memcache …

    Read more →
  • Bit manipulation in PHP
    Jun 2, 2010 ·

    Although you probably never need it as much as a C-programmer would, it’s not a bad idea to know how bit manipulation works. This post will tell you a bit about what bit manipulation is, why you …

    Read more →
  • Handling binary data in PHP with pack() and unpack()
    Jan 14, 2010 ·

    Nowadays most lowlevel functionality like reading or writing graphics are taken care of 3rd party libraries and that’s ok. It’s way to complicated to do things right and you probably want …

    Read more →
  • Big O notation
    Dec 21, 2009 ·

    Normally you would develop against a test-database. It probably contains about 10 people so you can do your programming and testing.. Once it’s done and QA’d, it will go live and people …

    Read more →