|
| 1 | +<?php |
| 2 | + |
| 3 | +class PropertyDemo { |
| 4 | + /* testPublicSetProperty */ public(set) mixed $pub1; |
| 5 | + /* testPublicSetPropertyUC */ PUBLIC(SET) mixed $pub2; |
| 6 | + public /* testPublicPublicSetProperty */ public(set) mixed $pub3; |
| 7 | + public /* testPublicPublicSetPropertyUC */ PUBLIC(SET) mixed $pub4; |
| 8 | + |
| 9 | + /* testProtectedSetProperty */ protected(set) mixed $prot1; |
| 10 | + /* testProtectedSetPropertyUC */ PROTECTED(SET) mixed $prot2; |
| 11 | + public /* testPublicProtectedSetProperty */ protected(set) mixed $prot3; |
| 12 | + public /* testPublicProtectedSetPropertyUC */ PROTECTED(SET) mixed $prot4; |
| 13 | + |
| 14 | + /* testPrivateSetProperty */ private(set) mixed $priv1; |
| 15 | + /* testPrivateSetPropertyUC */ PRIVATE(SET) mixed $priv2; |
| 16 | + public /* testPublicPrivateSetProperty */ private(set) mixed $priv3; |
| 17 | + public /* testPublicPrivateSetPropertyUC */ PRIVATE(SET) mixed $priv4; |
| 18 | + |
| 19 | + /* testInvalidUnsetProperty */ public(unset) mixed $invalid1; |
| 20 | + /* testInvalidSpaceProperty */ public (set) mixed $invalid2; |
| 21 | + /* testInvalidCommentProperty */ protected/* foo */(set) mixed $invalid3; |
| 22 | + /* testInvalidGetProperty */ private(get) mixed $invalid4; |
| 23 | + /* testInvalidNoParenProperty */ private set mixed $invalid5; |
| 24 | +} |
| 25 | + |
| 26 | +class ConstructorPromotionDemo { |
| 27 | + public function __construct( |
| 28 | + /* testPublicSetCPP */ public(set) mixed $pub1, |
| 29 | + /* testPublicSetCPPUC */ PUBLIC(SET) mixed $pub2, |
| 30 | + public /* testPublicPublicSetCPP */ public(set) mixed $pub3, |
| 31 | + public /* testPublicPublicSetCPPUC */ PUBLIC(SET) mixed $pub4, |
| 32 | + |
| 33 | + /* testProtectedSetCPP */ protected(set) mixed $prot1, |
| 34 | + /* testProtectedSetCPPUC */ PROTECTED(SET) mixed $prot2, |
| 35 | + public /* testPublicProtectedSetCPP */ protected(set) mixed $prot3, |
| 36 | + public /* testPublicProtectedSetCPPUC */ PROTECTED(SET) mixed $prot4, |
| 37 | + |
| 38 | + /* testPrivateSetCPP */ private(set) mixed $priv1, |
| 39 | + /* testPrivateSetCPPUC */ PRIVATE(SET) mixed $priv2, |
| 40 | + public /* testPublicPrivateSetCPP */ private(set) mixed $priv3, |
| 41 | + public /* testPublicPrivateSetCPPUC */ PRIVATE(SET) mixed $priv4, |
| 42 | + |
| 43 | + /* testInvalidUnsetCPP */ public(unset) mixed $invalid1, |
| 44 | + /* testInvalidSpaceCPP */ public (set) mixed $invalid2, |
| 45 | + /* testInvalidCommentCPP */ protected/* foo */(set) mixed $invalid3, |
| 46 | + /* testInvalidGetCPP */ private(get) mixed $invalid4, |
| 47 | + /* testInvalidNoParenCPP */ private set mixed $invalid5, |
| 48 | + ) {} |
| 49 | +} |
| 50 | + |
| 51 | +class NonVisibilityCases { |
| 52 | + function /* testProtectedFunctionName */ protected() {} |
| 53 | + function /* testPublicFunctionName */ public( |
| 54 | + /* testSetParameterType */ Set $setter |
| 55 | + ) {} |
| 56 | +} |
| 57 | + |
| 58 | +// Intentional parse error. This must be the last test in the file. |
| 59 | +class LiveCodingDemo { |
| 60 | + /* testLiveCoding */ private(set |
0 commit comments