Skip to content

Fix phpcredits() BC after remove Logo GUIDs - #155

Closed
reeze wants to merge 1 commit into
php:masterfrom
reeze:fix-phpcredits-bc
Closed

reeze wants to merge 1 commit into
php:masterfrom
reeze:fix-phpcredits-bc

Conversation

@reeze

@reeze reeze commented Aug 9, 2012

Copy link
Copy Markdown
Contributor

This test was affected: ext/standard/tests/general_functions/phpcredits2.phpt

https://github.com/php/php-src/pull/132/files#diff-3
This makes constant PHP_CREDITS_FULLPAGE didn't functional anymore.
see: http://php.net/phpcredits

Hi, @TazeTSchnitzel you might want to take a look at this :)

This test was affected: ext/standard/tests/general_functions/phpcredits2.phpt
see https://github.com/php/php-src/pull/132/files#diff-3
This makes constant PHP_CREDITS_FULLPAGE didn't functional anymore.
@hikari-no-yume

Copy link
Copy Markdown
Contributor

Ah, my bad, my bad. Have you tested and made sure it embeds the credits properly in phpinfo()?

@reeze

reeze commented Aug 9, 2012

Copy link
Copy Markdown
Contributor Author

Yes, it did embed correctly. and the test passed :)

I was trying to contact you on irc but I can't login seems been banned because of share ip :(

@hikari-no-yume

Copy link
Copy Markdown
Contributor

Have incorporated into this PR: #156

@reeze

reeze commented Aug 9, 2012

Copy link
Copy Markdown
Contributor Author

cool then this one could be closed

Reeze
Sent with sparrow

在 2012年8月10日星期五,2:10,Andrew Faulds 写道:

Have incorporated into this PR: #156

—
Reply to this email directly or view it on GitHub (#155 (comment)).

@php-pulls

Copy link
Copy Markdown

Comment on behalf of laruence at php.net:

included in PR 156

@php-pulls php-pulls closed this Aug 10, 2012
heyJordanParker added a commit to heyJordanParker/php-sharp that referenced this pull request Oct 11, 2026
Problem:
The note gave the computed-parameter and `lazy` errors as "A constructor
parameter cannot be …". The parser and check_slice raise both on every
PHP# parameter, method and lambda parameters included, so the text was
false where it fired. The note also did not say that `lazy` stays a name
before `(`, `)`, `,` or `=`.

Solution:
- The computed-parameter error reads "A parameter cannot be a computed
  property: a computed property has no incoming value to receive.", at the
  `=>`, team-lead's ruling on php#155's review.
- The `lazy` error reads "A parameter cannot be `lazy`: …", as PR 1 builds
  it. A parameter with only `lazy` is no promoted property, and
  `(lazy) => lazy` keeps compiling.

docs/architecture/slices/
└── 09-constructors.md    <- the two parameter errors, under "`lazy`, computed properties and `static`"
heyJordanParker added a commit to heyJordanParker/php-sharp that referenced this pull request Oct 13, 2026
Problem:
- `(lazy) => lazy ? 1 : 0` and `(lazy, int fallback) => …` compiled on
  master and gave a parse error here: `lazy` before `)` or `,` was read
  as a modifier.
- The computed-parameter error said "A constructor parameter" on every
  PHP# parameter, method and lambda parameters included.
- `public int Report() => 1;` followed by the constructor `Report` was
  called a second constructor, beside the method's own error.
- `lazy int extra` on a method parameter also got PHP's "Promoted
  properties are not allowed outside of constructors.", because any
  modifier counted as promotion.
- Deleting the `is_sharp()` check, or widening the guard clause to
  `break`, `continue` or a loop body, failed no test.

Solution:
- parse_optional_modifier reads a word as a modifier only when the next
  token is not `(`, `)`, `,` or `=`, the rule parse_parameter uses.
- The computed-parameter error reads "A parameter cannot be a computed
  property: a computed property has no incoming value to receive."
- check_members records the main constructor's span and reports only a
  constructor after a constructor. A constructor after a method of its
  name is not reported again; the method keeps its own error.
- is_promoted_property does not count `lazy`, which declares no member.
- New test rows pin each case.

crates/
├── syntax/src/
│   ├── parser/internal/modifier.rs           <- a word before `(`, `)`, `,` or `=` is a name
│   ├── error.rs                              <- "A parameter cannot be a computed property"
│   └── cst/cst/function_like/parameter.rs    <- is_promoted_property skips `lazy`
├── semantics/src/internal/checker/class_like/mod.rs   <- the main constructor's span decides a second one
├── syntax/tests/sharp.rs                     <- lambda parameters named `lazy`; a computed method parameter
├── semantics/tests/sharp.rs                  <- loop and `break`/`continue` rows; a method then a constructor;
│                                                `lazy` on a method parameter is one error
└── semantics/tests/duplicate_members.rs      <- a PHP method defined twice keeps PHP's message
heyJordanParker added a commit to heyJordanParker/php-sharp that referenced this pull request Oct 13, 2026
feat: accept the guard clause and name section 9's constructor refusals
heyJordanParker added a commit to heyJordanParker/php-sharp that referenced this pull request Oct 13, 2026
Problem:
Master gained php#156 (the Lean setup check), php#155 (constructors) and php#158 (the test guards:
patch-coverage and mutants). One file conflicted: the `check_slice` doc in
`crates/semantics/src/internal/checker/sharp.rs`, where php#155 allows a braceless guard
clause and this branch says a type parameter as a catch type is not supported yet.

Solution:
The doc keeps php#155's guard-clause sentence and this branch's catch-type sentence.

crates/semantics/src/internal/checker/sharp.rs   <- conflict: both doc sentences
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants