Recently, I asked whether the Elastic APM agent could support Micrometer’s @Timed annotation for method-level timings. That feature would let me avoid using AspectJ solely for this purpose. Of course, I could add manual instrumentation, but I’d rather not pollute my business logic with observability concerns. JEP 520 , arriving with Java 25, introduces jdk.MethodTiming and jdk.MethodTrace events…
I have added “Parameter Type Widening” to PHP 7.2 . The corresponding PR already got a lot of negative voices saying that it would break a lot of things. Recently there was another blog post saying how bad it is . Let me say one thing first: Omitting the type of a parameter does not break any caller of that method. Quoting from the above linked blog post: If you expect every implementation of your…
Async PHP allows a massive speedup of applications by leveraging non-blocking I/O. It allows making multiple HTTP requests in parallel or any other way of I/O multiplexing. But what’s the magic behind it? How does it actually work? Blocking I/O Blocking I/O is the traditional way of doing I/O in PHP. It means that any I/O request by the application is processed synchronously. The application’s…
Generators have been added to PHP in version 5.5, yet they have received rather low attention. The PHP 5.5 migration guide introduced them as way to implement simple iterators. Support for generators has been added via the yield keyword. Generators provide an easy way to implement simple iterators without the overhead or complexity of implementing a class that implements the Iterator interface. It…
Recently, we added support for the system configuration on Windows to amphp/dns . While we had Travis running for a long while, Travis doesn’t offer Windows builds. I knew AppVeyor was a thing, but I couldn’t find a good example for running PHP on it, so I had a look at a repository of Cees-Jan Kiewiet . Following that repository, we have running tests on Windows now. If you want to know more…
Did you ever want multiple developer environments without ever changing URLs? Nginx can help you. Unlike Apache, Nginx can be configuered very dynamically. You can use map to map cookie values to document roots. map $ cookie_environment $ environment { default production ; feature feature ; develop development ; } You can use the $environment variable then in paths to root . You can also add a…
Typography plays an important role when designing, not only for the web. It’s most important for sites like blogs, where users are reading almost all the time. When writing the design for my blog, I already had in mind that font-size , line-height and width of the lines are important. I increased the default line height to 180% and gave all headings more whitespace for better readability. What I…
Artax is an asynchronous HTTP/1.1 client built on the Amp concurrency framework . Mocking can be great to help testing, especially for testing error cases which can be hard to receive otherwise with real requests / responses. Mocking a HTTP response with Artax and PHPUnit is quite easy. $response = new Response ; $response -> setStatus ( 200 ); $response -> setBody ( json_encode ([ "type" =>…
Let’s Encrypt , the free and automated CA, started late last year into their public beta. They offer a pretty comprehensive client to automate the process of getting SSL clients and installing them. It will soon be moved to a new home at EFF . If you’re already using PHP and don’t need / want the automatic installation of your free certificates or don’t want to install Python, here’s a client for…
Namecheap published a blog post recently explaining the difference between Namecheap’s paid SSL and other free CAs . They said they want to cover the facts, so I’ll write about the actual facts here. I added quotes everywhere and took their headings to make it easy to read the corresponding parts in the original blog post. Update Namecheap updated their blog post and removed almost all of the…