php / php/php-src

var_export on anonymous classes

Đang mở
#10,066 15 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Bug Category: Engine Extension: standard Status: Verified
Ngôn ngữ chính
C
Star
40.4k
Fork
8.1k
Merge trung bình
2 ngày 13 giờ
Pull request đã merge (30 ngày)
96

Mô tả

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

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
c, php
Lĩnh vực
backend
Loại issue
Lỗi
Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
35/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.