apache / apache/netbeans

[PHP] Instantiation using an inaccessible constructor must produce error

Open
#6,041 0 comments 0 reactions 0 assignees View on GitHub
kind:feature needs:triage PHP
Dominant language
Java
Stars
3.1k
Forks
935
Avg merge
2d 3h
Merged PRs (30d)
17

Description

### Apache NetBeans version

Apache NetBeans 18

### What happened

PHP allows constructor to be declared with private or protected visibility. This feature is useful for creating singleton (and may be other pattern).

### How to reproduce

```php

Contributor guide

Open the contributing guide

Research direction

No source file or test is named. Start by running the PHP reproduction in the issue and trace the NetBeans PHP support that reports constructor visibility errors; done means direct instantiation of the inaccessible constructor reports an error while the two factory calls remain valid.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.