🐘 PHP Digest

78 result(s) for “object”

1
IPTC export changed in Photos for macOS 26 Tahoe

I've recently upgraded my MacBook Air to macOS 26 Tahoe and one thing I noticed was that Rodeo's rules were no longer working. With the help of exiftool, I worked out that when exporting to JPEG from Photos for macOS 26 Tahoe, the Object Name, Caption-Abstract and Keywords IPRC …

Blogs akrabat.com 💬 5 Rob 7mo ago
2
A Dead Simple intro to Destructuring JavaScript Objects

Destructuring is a huge part of ES6. If you want to learn all about the different parts of destructuring check out my ES6.io video tutorials or read some of the other articles on this blog. This post is a dead simple introduction to what destructuring actually is . Along with ar…

Blogs wesbos.com 💬 55 wesbos 117mo ago
3
Setting Default Values with JavaScript’s Destructuring

There’s one last thing we need to know about destructuring objects, and that is the ability to set defaults. This one’s a little bit confusing, so bear with me here and we’re going to circle back for another example later on in a couple of videos over at ES6.io…

Blogs wesbos.com 💬 21 wesbos 117mo ago
4
Personal maps: создаём директиву для подключения Google Maps. Часть 7.

В этой части мы рассмотрим разработку и использование директивы AngularJS, которая позволит добавить карту в интерфейс нашего приложения. Ссылки на предыдущие статьи вы найдете в конце страницы. Директивы в AngularJS предназначены для работы с DOM (Document Object Model – объект…

Blogs simplecoding.org 💬 15 Владимир 155mo ago
5
Objects as keys

I’m going to put to vote soon another of my RFCs, namely one about “objects as keys“. So, I want to outline the case for it here and address some criticisms and questions raised while discussing it. Why we may want it it? Traditionally, in PHP array keys could …

Blogs php100.wordpress.com 💬 8 Stas 140mo ago
6
Interfaces and Traits: A Powerful Combo

If you're not using interfaces in PHP, you are missing out on a powerful object-oriented programming feature. An interface defines how to interact with a class. By defining an interface and then implementing it, you can guarantee a "contract" for consumers of a class. Interfaces…

Blogs blog.everymansoftware.com 💬 3 Josh Adell 167mo ago
7
Request objects in Tempest

Read the full post on https://stitcher.io/blog/request-objects-in-tempest

Blogs stitcher.io Brent 15mo ago
8
Benjamin on Lazy Objects at SymfonyLive Berlin

What: SymfonyLive 2026 Where: CineStar CUBIX Berlin When: April 23-24, 2026 Benjamin will be attending SymfonyLive 2026 and contributing a talk focused on one of the most relevant changes in modern PHP. With PHP 8.4, native support for lazy loading and proxy objects becomes part…

Blogs tideways.com Diana Scheffen 2mo ago
9
Casting weirdness with PHP

When my coworker today asked if he could cast an array to a object. I couldn’t really answer the question. Don’t think i ever done that. So let’s try. right? Cast array to object $arr = array('foo' => 'baz'); $obj = (object) $arr; var_dump($obj); object(stdClass)#1 (1) { [&qu…

Blogs lenss.nl Thijs Lensselink 161mo ago
10
Accessing undefined properties of hashes/objects (in PHP and more)

by Yitzchak Schaffer (@YitzOfTheBits) The true focus of this post is how to retrieve given member values of associative arrays in PHP, but it will touch on analagous constructs in other popular languages, namely Java’s Map, Python’s dict, Ruby’s Hash, and Javas…

Blogs dev.imagineeasy.com yitznewton-blog 146mo ago
11
Interview with Matthias Noback

Cal Evans hosts his friend Matthias Noback as they talk about Domain Driven Design and Matthias’ new book “Recipes for Decoupling. @matthiasnoback Show Notes Recipes for Decoupling Matthias Noback's blog Object Design Style Guide Audio This episode is sponsored …

Blogs voicesoftheelephpant.com cal@voicesoftheelephpant.com (Cal Evans) 50mo ago
13
What traffic do you get when mentioned by several Ruby authorities?

EDIT: Some of my latest articles have had traffic orders of magnitude larger than the one mentioned below, making the figures completely obsolete. It looks like my latest blog post, A Diagram of the Ruby Core Object Model, has had quite a bit of a success in the Ruby community. …

Blogs jeromedalbert.com Jerome Dalbert 153mo ago
14
A diagram of the Ruby Core object model

I am a visual learner. A picture is worth a thousand words. When I started learning Ruby, I could not find a decent diagram that would just sum up the Ruby classes, modules, and their hierarchy. So I made mine. By hand. On an A4 sheet. Here is the result (click for a full size v…

Blogs jeromedalbert.com Jerome Dalbert 155mo ago
15
Python Data Classes make it easy to fetch database rows as objects

Python-oracledb rowfactories are a powerful way for Oracle Database queries to alter the representation of fetched rows, reducing the amount of application boilerplate code and data copying. This blog shows how easy it is to use a Python Data Class with a rowfactory to transform…

Blogs medium.com Christopher Jones 9mo ago
16
This blog writes itself.

DateTimeImmutable::modify() Alters the timestamp. Like DateTime::modify() but works with DateTimeImmutable. Duh. I don’t see what’s so hard about this, @pda. Of course, it doesn’t actually do what the name says and modify an unmodifiable object at all. So, at least there’s that;…

Blogs phpmanualmasterpieces.tumblr.com 146mo ago
17
Immutable objects

In this short article we will see what immutable objects are and why we should consider to use them. Immutable object is an object that does not change its state after it was created. Immutable objects usually are very simple. You may already seen them as enum types or primitive…

Blogs ragazzo.github.io 123mo ago
18
PHP Object Lazy-Loading is More Than What You Think

We recently attended a talk about lazy-loading by Nicolas Grekas and it inspired me this blogpost! We can find lazy-loading in all modern PHP applications, in ORMs, for example. But is there more usage…

Blogs jolicode.com 21mo ago
19
Thoughts on the symmetry between good test names and your object's API

While running coderetreats, I have the opportunity to see a lot of people working on Conway’s Game of Life. As we go through the day, I make comments about design, both in the large and in the small. Over the years, I’ve seen similar patterns pop up across many different develop…

Blogs articles.coreyhaines.com Corey Haines 150mo ago
21
From Minutes to Seconds: Massive Performance Gains in PHPStan

Strongly-typed object-oriented code helps me tremendously during refactoring. When I realize I need to pass more information from one place to another, I usually take my first step by changing a return typehint, or adding a required parameter to a method. Running PHPStan after m…

Blogs medium.com Ondřej Mirtes 77mo ago
22
IV. Adding Context to Requests

We're going to discuss Golang's "context" objects (context.Context). I'll assume you're at least passingly familiar with them. It's useful if your request handlers can share information about a request. Often the request data itself (http.Request) has everything you ne…

Blogs fideloper.com 45mo ago
23
Changing the Laravel Log File Name (and playing in the Http/Console Kernels)

#vimeoembed { position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; max-width: 100%; height: auto; } #vimeoembed iframe, #vimeoembed section object, #vimeoembed section embed { position: absolute; top: 0; left: 0; width: 100%; height: 100%; } Here's a video ex…

Blogs fideloper.com 115mo ago
24
Stateless Services

Stateless Services As more frameworks and libraries, particularly in the PHP world, move towards adopting the Dependency Injection pattern they are all faced with the problem of bootstrapping their application and constructing the object graph. In many cases this is solved by a …

Blogs igor.io Igor Wiedler 72mo ago
25
PHP Records vs Structs: Simplifying Immutability in PHP

As a long-time PHP enthusiast and contributor, I’ve always been fascinated by how PHP can evolve to improve developer experience while maintaining its simplicity. Over the years, I’ve explored various ways to enhance the language, including my previously published Object Initial…

Blogs brzuchal.com Michał Brzuchalski 19mo ago
26
PHP 8.0: Object Initializer Proposal

In this article, we’re gonna demystify RFC: Object Initializer which was proposed by me up for discussion on PHP Internals. Motivation The motivation behind Object Initializer RFC was dictated by a large number of repetitions when creating simple objects like DTO and a lot…

Blogs brzuchal.com Michał Brzuchalski 82mo ago
27
Inner Classes in PHP Concept

I’d like to present my concept of inner classes for PHP based on other languages and PHP limitations. What are those inner classes? Nested Inner Class UML In object-oriented programming (OOP), an inner class or nested class is a class declared entirely within the body of a…

Blogs brzuchal.com Michał Brzuchalski 116mo ago
28
Why Object Types are useful in Hydrators and Extractors

There are many implementations of Hydrator and Extractor pattern. What is Hydration? Hydration is the act of populating an object from a set of data. Hydrators have wide usage in ORM and Data Mappers their responsibility is to provide entity objects from relational database. Hyd…

Blogs brzuchal.com Michał Brzuchalski 119mo ago
29
Simple Dic With Object Typehint

Following the raging success of PHP 7.0 additions scalar type hints and return types, there is also place for object typehint and return type. That feature can replace double is_object() validation inside function/method. I decided to write an RFC:Object-typehint. Why do we need…

Blogs brzuchal.com Michał Brzuchalski 120mo ago
30
Clean Code and Object Calisthenics Rules I try to Follow

I do a lot of Code Reviews, and without proper automation of most of the low level items that you are usually "remarking" to colleagues it is a frustrating experience for everyone involved and takes more time that needed. My natural tendency is towards action over plan…

Blogs beberlei.de Benjamin 77mo ago
31
Symfony Object Mapper component

Symfony Object Mapper Component# Check out the slides of my conference at the Symfony Con: Mapping is something that you see in many frameworks over the web in every programming languages. Doctrine, for example, has a quite complex mapper to transform the relational database rep…

Blogs soyuka.me 19mo ago
33
What You Need To Know About Swift

Have you heard of the Swift programming language? Swift is a programming language used general-purpose which is developed by Apple Inc. It’s a multi-paradigm (object-oriented, protocol-oriented, block-structured etc.) programming language which is mainly developed for iPad…

Blogs sheriframadan.com Sherif 73mo ago
34
Introducing CTOR: Prefer Constructor over Always-Called Setters

We've all seen it: `new Human()` followed by three `setName()`, `setAge()`, `setEmail()` calls that are always there. Not optional - just pretending. These are constructor arguments in a fluent disguise, and they leave your objects half-valid every time someone forgets one. So I…

Blogs tomasvotruba.com Tomas Votruba 1mo ago
35
A horrifying `globalThis` polyfill in universal JavaScript

The globalThis proposal introduces a unified mechanism to access the so-called “global object” a.k.a. “the global” in any JavaScript environment. It sounds like a simple thing to polyfill, but it turns out it’s pretty hard to get right.

Blogs mathiasbynens.be Mathias 87mo ago
36
Unquoted property names / object keys in JavaScript

Fun fact: var foo = { H̹̙̦̮͉̩̗̗ͧ̇̏̊̾Eͨ͆͒̆ͮ̃͏̷̮̣̫̤̣Cͯ̂͐͏̨̛͔̦̟͈̻O̜͎͍͙͚̬̝̣̽ͮ͐͗̀ͤ̍̀͢M̴̡̲̭͍͇̼̟̯̦̉̒͠Ḛ̛̙̞̪̗ͥͤͩ̾͑̔͐ͅṮ̴̷̷̗̼͍̿̿̓̽͐H̙̙̔̄͜: 42 }; is valid JavaScript. It may not be immediately obvious, but the real surprise here is that the Cthulhu-esque property name is not surrounded by q…

Blogs mathiasbynens.be Mathias 174mo ago
37
Using ServiceManager 3 lazy services to improve your PHP application performance

Performance is an important subject when a project grows. There are some good practices that make projects more maintainable, like dependency injection, however, creating all the objects at the beginning of the request could reduce the application performance. If some of the cre…

Blogs alejandrocelaya.blog 122mo ago
38
JSON interpreter in Io

Io is amazing. Here’s a (naive) JSON interpreter in Io. JSON := Object clone do( curlyBrackets := method( call message arguments foreach(msg, self setSlot( call sender doString(msg name), JSON clone doMessage(msg next ?next) ) ) self ) squareBrackets := method( call message argu…

Blogs anttih.com Antti Holvikari 190mo ago
39
Solar Blog - Using registry_set to auto-register objects

I have just published my first entry on the new Solar project blog. Go read about Using registry_set to auto-register objects. It’s one of the cool new features of Solar version 1.0.0alpha2.

Blogs anttih.com Antti Holvikari 216mo ago
40
How to use external services with the Symfony Validator

Validation is one of the most common tasks when building many types of software applications. Talking more specifically about the Symfony Framework, its Validator component offers a very powerful set of APIs to validate objects, arrays, forms and much more. We are going to see a…

Blogs goetas.com Asmir Mustafic 82mo ago
41
What's new in jms/serializer v2.0

After more than a two years of work (the first commit was on July 20 2016), jms/serializer v2.0 is going to see the light. jms/serializer is a popular library to serialize/deserialize objects from/to XML and JSON. The installs counter on packagist has already passed 20 million d…

Blogs goetas.com Asmir Mustafic 95mo ago
42
Deserialization, normalization, validation and the JMS Serializer

Recently, while speaking at the Symfony Berlin User Group, during the Q&A session, I was asked to comment on how to solve an issue when using FOS REST Bundle and JMS Serializer. The JMS Serializer is a library that allows to serialize and deserialize and object graph into a …

Blogs goetas.com Asmir Mustafic 107mo ago
43
POODNYC 2015 Scholarships have been awarded

Scholarships for the Oct 19-21 Practical Object-Oriented Design Course (POODNYC) in New York City have been awarded! Winners are listed below, but before I introduce them I'd like to give an overview of the applicant pool and selection process. I'll be awarding scholarships for …

Blogs sandimetz.com Sandi Metz 132mo ago
44
Suspicions of nil

I'm feeling suspicious of nil. What is nil? In a recent newsletter I pondered true and false and suggested that thinking of them as normal, everyday objects could expand your ideas about OOP.  Today I'll continue with this theme by considering nil. What _is_ nil? A str…

Blogs sandimetz.com Sandi Metz 140mo ago
45
POODNC Scholarships Have Been Awarded

Scholarships for the Oct 29-31 Practical Object-Oriented Design Course (POODNC) in Durham, NC have been awarded!  Winners are listed below, but before I introduce them I'd like to give an overview of the applicant pool and selection process. I'll be awarding scholarshi…

Blogs sandimetz.com Sandi Metz 143mo ago
46
How Shall We Define Design?

I love object-oriented design. It’s like open source software in general; perfect strangers come up with ideas that can save me time and money and then, out of the goodness of their hearts, go to a fair amount of trouble to pass these ideas on. I benefit from their efforts every…

Blogs sandimetz.com Sandi Metz 170mo ago
47
Ruby Case Statements and `kind_of?`

You’re an object – Stand up straight and act like one! Imagine you have this code: Code 1: class MyView attr_reader :target def initialize(target) @target = target end def double case target when Numeric then target * 2 when String then target.next # lazy example fail when Array…

Blogs sandimetz.com Sandi Metz 207mo ago
48
SOLID Design Principles - Dependency Injection

Not as Painful as it sounds… Nothing is more pleasing than beautiful code. And nothing is more heart-breaking than watching beautiful code get destroyed. Lately, I’ve been paying particular attention to SOLID Object Oriented Design (OOD) principles and their interaction with TDD…

Blogs sandimetz.com Sandi Metz 210mo ago
49
Rails serialize JSON with symbolize_names

Haven’t found a better solution class Something < ActiveRecord::Base class JsonSymbolized def self.load(string) JSON.parse(string, symbolize_names: true) end def self.dump(object) object.to_json end end serialize :field, JsonSymbolized end

Blogs rarestblog.com Slava Vishnyakov 140mo ago
50
Data Mapper Injection in PHP Objects

I was trying to figure out a simple way to have data from a database injected into a domain object in PHP. I don't want to enforce that the domain object implements setters and getters for every property, and the burden on the developer for implementing the data injection interf…

Blogs blog.everymansoftware.com Josh Adell 173mo ago
52
Want Clean Code? Just Use Functions.

Earlier on in my programming career, I got pretty heavy into Object-Oriented Programming and all the various design patterns around it (there are a lot). I used to worship at the alter of Martin Fowler and zealously look for opportunities to implement all of the various Gang of …

Blogs vancelucas.com vlucas 13mo ago
53
Precision Through Imprecision: Improving Time Objects

tl;dr When creating value objects representing time, I recommend choosing how finegrained the time should be with your domain experts and round it off to that precision in the value object. When modeling important numbers, it’s considered good form to specify the precision. Whet…

Blogs rosstuck.com Ross Tuck 108mo ago
55
Four ways of declaring interfaces in Haskell

When we think about interfaces in software development, it’s easy that our thoughts go the interface keyword used in many Object-Oriented languages like Java and C#. But interfaces are a much more general concept, and they could be defined as: an interface is a shared boundary a…

Blogs marcosh.github.io 11mo ago
56
Either why or how

Either is one of the easiest data structures which can be used to make your code safer and more composable. It is not particularly complex but sometimes it is still hard to grasp, especially for programmers used to a procedural or object oriented approach. In this post I’ll try …

Blogs marcosh.github.io 58mo ago
57
so.ch: Cantonal services made simple for everyone

The so.ch website follows a clear objective: users should be able to get things done quickly, directly, and without unnecessary detours. Instead of reflecting the traditional administrative logic of “Which office is responsible?”, so.ch focuses on the user’s actual need: “…

Blogs liip.ch 1mo ago
58
Creating test doubles in pure PHP

The PHP world is not known for good unit test coverage. It’s mostly a cultural issue, but there is a technical aspect to it as well. PHPUnit allows you to create mock objects, but that assumes your codebase uses the Depedency Injection pattern. If not, it’s very hard to add...

Blogs scribu.net 155mo ago
59
Getting the class name from an object instance

I was recently assigned to work on a node.js project — a first, for me. I discovered that it comes with a neat CLI debugger built in, which is very handy when diving into an unknown codebase. However, when inspecting a variable, it doesn’t show me its type; only its...

Blogs scribu.net 157mo ago
60
PHP Coding Puzzle 10 : Sudoku Game

Welcome to the 10th PHP Coding Puzzle ! The Sudoku Game The objective of Sudoku is to fill a 9×9 grid with numbers so that each row, column, and 3×3 sub-grid (or “box”) contains all of the digits from 1 to 9. To solve a Sudoku puzzle, you need to use logic …

Blogs phpmagazine.net Hatem Ben Yacoub 39mo ago
61
PHP Design Patterns Game : The Strategy Pattern

Welcome to our new series of articles, PHP Design Patterns Games! In this article, we will explore the Strategy Pattern, which is a behavioral design pattern that enables an object, called the context, to change its behavior dynamically by selecting a suitable algorithm from a g…

Blogs phpmagazine.net Hatem Ben Yacoub 39mo ago
62
The _with Function Pattern in Rust

I really like _with style functions that accept a FnOnce callback. The scoping rules work out really well when using these functions. I was working with the slab crate recently and used the Slab#insert_with function. This function takes a callback where an object is supposed to …

Blogs hermanradtke.com Herman J. Radtke III 133mo ago
63
Get More Content Into Your Ember Apps

Working is extremely nice once you have a grasp on the basic concepts. But, one of the coolest promises (some pun intended) is the ability to use the render view helper. At its core, the render object lets you render a template with a view class wrapping it. However, the real po…

Blogs ryantablada.com 148mo ago
64
Hacking Into Ember Model

Today, I was playing with Ember Model while looking at refactoring from a raw Backbone project to Ember. Since writing this article, I have found a more useful reopen method within Ember's Object Model. One of the things that immdiately hit me was that all requests are built by …

Blogs ryantablada.com 156mo ago
66
Improving Laravel Architecture With Expressive

Learn how Expressive can improve a Laravel application by keeping Eloquent as the database layer while moving business logic to fully typed objects. Read more

Blogs freek.dev Freek Van der Herten 9d ago
67
Benchmarking Cache Transcoders in PHP

Motivation Storing PHP objects (or simpler data types like arrays) in caches always requires some kind of transformation. You need a way of encoding/decoding data so that it can be stored and loaded properly. In most languages, this process is known as object serialization. PHP …

Blogs nitschinger.at 163mo ago
68
Open Sourcing Mental Illness Handbooks

One of the most important objectives for the Open Sourcing Mental Illness project is to help people get the support they need for mental health challenges in the workplace. I’m so proud that we’ve had our Mental Health in Tech guidelines available as ebooks from our …

Blogs geehock.wordpress.com Gary 118mo ago
69
integrating zend form in zend expressive and view

Example is based using Aura.Di. But the functionality will be same for any containers. First register the service Zend\View\HelperPluginManager, so that we can access the same object. To register the form helpers, create the object of Zend\Form\View\HelperConfig and pass the Zen…

Blogs harikt.com 129mo ago
70
aura dot http request and response

The Aura.Http package provide you the tool to build and send request and response. Instantiation: # The easiest way is 1 2 3 <?php $http = require 'path/to/Aura.Http/scripts/instance.php'; What it gives you is an object of Aura\Http\Manager. If you want to create manu…

Blogs harikt.com 162mo ago
71
Hacking PHP’s WeakMap for Value Object D×

This guide will allow you to use value objects in PHP without a special $obj->equals() method. Instead, you can use the === or == operator to compare two value objects. This guide will also show you how to use a…

Blogs withinboredom.info 24mo ago