php / php/php-src

var_export on anonymous classes

Offen
#10,066 15 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Bug Category: Engine Extension: standard Status: Verified
Vorherrschende Sprache
C
Sterne
40.4k
Forks
8.1k
Ø Merge
2 T. 13 Std.
Gemergte PRs (30 T.)
96

Beschreibung

Description

I couldn't find that reported, so I'll open a new issue.

The following code:

<?php
var_export(new class{});

Resulted in this output: https://3v4l.org/CQ6qK

\class@anonymous/in/CQ6qK:3$0::__set_state(array(
))

But I expected this output instead:

NULL

or

new class {}
PHP Version

PHP 8.2 and older

Operating System

No response

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Start by reproducing var_export(new class{}); on the PHP versions mentioned in the issue and inspect the reported output. Read the 15-comment thread to determine whether the intended result is NULL or a reconstructible anonymous class, then verify the chosen behavior against the reproducer.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
c, php
Bereich
backend
Issue-Typ
Bug
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
35/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.