---
title: "[RFC] [Discussion] Friends"
url: https://daily.dev/posts/rfc-discussion-friends-pz8k1nsld
source_url: https://externals.io/message/131128
type: article
source: "externals.io"
published: 2026-06-03T23:31:07.222Z
updated: 2026-06-03T23:31:36.973Z
tags: ["general-programming", "php"]
reading_time: 14
upvotes: 0
comments: 0
language: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# [RFC] [Discussion] Friends

**[externals.io](https://daily.dev/sources/externals)** · 14 min read · 0 upvotes · 0 comments

## Summary

A PHP internals mailing list discussion about a proposed RFC to add C++-style 'friend' class declarations to PHP. The RFC would allow a class to grant another class access to its non-public members. Key debate centers on Liskov Substitution Principle (LSP) violations: when a parent class grants friendship, subclasses can shadow private properties with incompatible visibility, causing runtime errors. Several solutions are discussed including requiring final classes, prohibiting property shadowing, upcasting syntax, and limiting friend access to protected (not private) members. The RFC author ultimately decides to restrict friendship to protected properties/methods/constants only to avoid LSP issues, triggering a 14-day cooldown period for the major change.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://externals.io/message/131128>

## Similar posts on daily.dev

- [\[RFC\] \[Discussion\] Friends](https://daily.dev/posts/rfc-discussion-friends-aairfxjve) · externals.io · 0 upvotes · 0 comments
- [\[RFC\] \[Discussion\] Friends](https://daily.dev/posts/rfc-discussion-friends-zrggwmmbr) · externals.io · 0 upvotes · 0 comments
- [\[RFC\] \[Discussion\] Friends](https://daily.dev/posts/rfc-discussion-friends-v030ubrjm) · externals.io · 0 upvotes · 0 comments

---

Tags: [#general-programming](https://daily.dev/tags/general-programming), [#php](https://daily.dev/tags/php)

[View this post on daily.dev](https://daily.dev/posts/rfc-discussion-friends-pz8k1nsld)
