Systems | Development | Analytics | API | Testing

PHP

A friendly introduction to PHP testing

In the last few years, there has been a lot of movement around new and exciting PHP testing tools. While this is great news, stepping back a little and understanding the underlying concepts before jumping in is vital to writing great PHP tests. When we talk about testing tools and methodologies, we're referring to automated testing tools. Writing code that tests your PHP apps is a great way to build confidence that your application will behave as you expect.

Tideways joins the Open Source Pledge

Tideways is joining the Open Source Pledge because we want to make a public commitment on our various open source contributions. Not only do we rely on open source software in our product Tideways, we are also building our business on top of the open source language PHP and its continued success. The mission of the recently started Open Source Pledge initiative is to establish a new social norm in the tech industry of companies paying Open Source maintainers.

How we use hyperfine to measure PHP Engine performance

One of our recurring jobs at Tideways is to ensure that all of our instrumentation works with the new and upcoming PHP versions. For us, “working” doesn’t just mean that the results are correct, but that your PHP extension is fast, gathering insights for our customers with a minimal performance overhead.

PHP 8.4 Property Hooks: Can we get rid of getters/setters now? A benchmark.

The upcoming PHP 8.4 release will include the brand-new feature “property hooks”, a mechanism to add logic to a class property when read from or written to. One benefit of this feature is that you do not need to protect property access with a private property and public getter/setter methods anymore. You can find out how this feature works in the RFC and other places, but in the spirit of this blog we want to focus solely on the performance implications.

The ultimate guide to Laravel caching

In the web development world, speed and performance are must-haves. Whether you're building a static website, software-as-a-service (SaaS), or bespoke web software, it's important that everything loads quickly to keep your users happy. One of the most common ways to optimize for speed in Laravel is caching. Caching refers to the practice of storing data inside a "cache" or high-speed storage layer.

Choosing a PHP Library based on Performance

Sometimes, performance is the primary requirement when you are picking a third-party library to solve a task in your application. For CPU intensive work, there are often similar alternatives that you can choose from: To find out which one of them is more performant for your use-case, you can set up an experiment with microtime/hr_time calls and run them against each other. But: this provides fewer insights than running your tests directly with a Profiler such as XHProf or Tideways!

Dealing with MySQL Lock Timeouts: Bail faster

When using MySQL and InnoDB you will inevitably run into lock timeouts sometime, somewhere. We have recently started seeing this with some of our Shopware 6 customers in their storefronts or worker queues, so I was reminded to go back to 2017 in our codebase when we put a fix in place. In our case, this happened on tables that were constantly written to from many different sources in the code base.

Tideways 2024.2 Release

Get the cake, Tideways is turning ten! Exactly on this day ten years ago, we lifted the veil on Tideways’ predecessor and thus began our exciting journey that continues to this day. We would like to celebrate by presenting interesting new features to you. Summary: Don’t miss out on our webinar that will guide you through these new features, taking place July 3rd starting at 3 pm.

New in PHP 8.4: engine optimization of sprintf() to string interpolation

PHPs compiler and bytecode cache OPcache not only cache the compile step from PHP source code to virtual machine bytecode, they also include optimizations that can produce faster bytecode: For example PHP can: For PHP 8.4 Tideways sponsored the work of our colleague Tim to add another compiler optimization for the function sprintf().

A guide to PHP attributes

When building web applications in PHP, there may be times when you want to add metadata to annotate your code that can be read by other parts of your application. For example, if you've ever used PHPUnit to write tests for your PHP code, you'll have likely used the @test annotation to mark a method as a test in a DocBlock. Traditionally, annotations like this have been added to code using DocBlocks. However, as of PHP 8.0, you can use attributes instead to annotate your code in a more structured way.