forked from rosswintle/can-i-php
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfeatures.js
614 lines (614 loc) · 18 KB
/
features.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
const features = [
{
name: "Fibers (Fiber class, Fiber exceptions)",
description:
"Lightweight concurrency for PHP. Fibers represent full-stack, interruptible functions. Fibers may be suspended from anywhere in the call-stack, pausing execution within the fiber until the fiber is resumed at a later time.",
keywords: [
"class",
"types",
"functionality",
"concurrency",
"interruptible",
"functions",
],
added: "8.1",
deprecated: null,
removed: null,
resources: [
{
name: "PHP.Watch Introduction to Fibers (php.watch)",
url: "https://php.watch/versions/8.1/fibers",
},
{
name: "Fibres overview and documentation (php.net)",
url: "https://www.php.net/manual/en/language.fibers.php",
},
],
},
{
name: "Enums",
description: "Enums are a way to define a set of named constants.",
keywords: ["constants", "class", "classes"],
added: "8.1",
deprecated: null,
removed: null,
resources: [
{
name: "Enums",
url: "https://stitcher.io/blog/php-enums",
},
],
},
{
name: "Array unpacking with string keys",
description:
"e.g. <code>$result = ['a' => 0, ...$arrayA, ...$arrayB];</code>",
keywords: ["spread", "unpacking", "arrays", "deconstruct"],
added: "8.1",
deprecated: null,
removed: null,
resources: [
{
name: "RFC (php.net)",
url: "https://wiki.php.net/rfc/array_unpacking_string_keys",
},
],
},
{
name: "Readonly properties",
description:
"A property can be declared with the readonly modifier, which prevents modification of the property after initialization.",
keywords: ["objects", "classes", "properties", "modifier"],
added: "8.1",
deprecated: null,
removed: null,
resources: [
{
name: "Readonly properties (php.net)",
url: "https://www.php.net/manual/en/language.oop5.properties.php#language.oop5.properties.readonly-properties",
},
],
},
{
name: "never type",
description:
"<code>never</code> is a return type indicating the function does not return.",
keywords: ["types", "typehints", "return"],
added: "8.1",
deprecated: null,
removed: null,
resources: [
{
name: "Readonly properties (php.net)",
url: "https://www.php.net/manual/en/language.types.declarations.php#language.types.declarations.never",
},
],
},
{
name: "new in initializers",
description:
"Use <code>new</code> expressions inside parameter default values, attribute arguments, static variable initializers and global constant initializers.",
keywords: ["new", "objects"],
added: "8.1",
deprecated: null,
removed: null,
resources: [
{
name: "new in initializers (stitcher.io)",
url: "https://stitcher.io/blog/php-81-new-in-initializers",
},
],
},
{
name: "First-class callable syntax ",
description:
"The first class callable syntax is introduced as of PHP 8.1.0, as a way of creating anonymous functions from callable.",
keywords: ["closures"],
added: "8.1",
deprecated: null,
removed: null,
resources: [
{
name: "First class callable syntax (php.net)",
url: "https://www.php.net/manual/en/functions.first_class_callable_syntax.php",
},
],
},
{
name: "Intersection types",
description:
"An intersection type declaration enforces that a value must belong to all of the declared types.",
keywords: ["types", "typehints", "declarations"],
added: "8.1",
deprecated: null,
removed: null,
resources: [
{
name: "Intersection types (php.net)",
url: "https://www.php.net/manual/en/language.types.declarations.php#language.types.declarations.composite.intersection",
},
{
name: "Intersection types (PHP.Watch)",
url: "https://php.watch/versions/8.1/intersection-types",
},
],
},
{
name: "Attributes",
description:
"Attributes, also known as annotations in many other languages, can be used to add meta data to classes, methods, variables and what not; in a structured way. Like docblocks, but recognised properly by PHP.",
keywords: [
"annotations",
"docblocks",
"documentation",
"metadata",
"reflection",
],
added: "8.0",
deprecated: null,
removed: null,
resources: [
{
name: "Attributes (php.net)",
url: "https://www.php.net/manual/en/language.attributes.overview.php",
},
{
name: "Attributes (stitcher.io)",
url: "https://stitcher.io/blog/attributes-in-php-8",
},
],
},
{
name: "Union types",
description:
"A union type declaration accepts values of multiple different simple types, rather than a single one. Also referred to as composite types.",
keywords: ["types", "typehints", "declarations", "composite type"],
added: "8.0",
deprecated: null,
removed: null,
resources: [
{
name: "Union types (php.net)",
url: "https://www.php.net/manual/en/language.types.declarations.php#language.types.declarations.composite.union",
},
],
},
{
name: "Constructor promotion",
description:
"Constructor parameters may be promoted to correspond to an object property.",
keywords: ["parameters", "properties", "classes", "promoted"],
added: "8.0",
deprecated: null,
removed: null,
resources: [
{
name: "Constructor promotion (php.net)",
url: "https://www.php.net/manual/en/language.oop5.decon.php#language.oop5.decon.constructor.promotion",
},
],
},
{
name: "match expression",
description:
"<code>match</code> is like <code>switch</code>, but returns a value.",
keywords: ["control", "structures", "switch", "conditionals"],
added: "8.0",
deprecated: null,
removed: null,
resources: [
{
name: "Match expression (php.net)",
url: "https://www.php.net/manual/en/control-structures.match.php",
},
],
},
{
name: "Named arguments",
description:
"Named arguments allow passing arguments to a function based on the parameter name, rather than the parameter position.",
keywords: ["parameters", "call", "functions"],
added: "8.0",
deprecated: null,
removed: null,
resources: [
{
name: "Named arguments (php.net)",
url: "https://www.php.net/manual/en/functions.arguments.php#functions.named-arguments",
},
],
},
{
name: "Nullsafe operator",
description:
"Nullsafe operator allows you to access properties and methods of nullable objects. e.g. <code>$country = $session?->user?->getAddress()?->country;</code>",
keywords: ["null"],
added: "8.0",
deprecated: null,
removed: null,
resources: [
{
name: "Nullsafe operator (stitcher.io)",
url: "https://stitcher.io/blog/php-8-nullsafe-operator",
},
],
},
{
name: "str_contains",
description: "Determine if a string contains a given substring",
keywords: ["functions", "helpers", "strings", "utilities", "utils"],
added: "8.0",
deprecated: null,
removed: null,
resources: [
{
name: "str_contains (php.net)",
url: "https://www.php.net/manual/en/function.str-contains.php",
},
],
},
{
name: "str_starts_with",
description: "Check if a string starts with a given substring",
keywords: ["functions", "helpers", "strings", "utilities", "utils"],
added: "8.0",
deprecated: null,
removed: null,
resources: [
{
name: "str_starts_with (php.net)",
url: "https://www.php.net/manual/en/function.str-starts-with.php",
},
],
},
{
name: "str_ends_with",
description: "Check if a string ends with a given substring",
keywords: ["functions", "helpers", "strings", "utilities", "utils"],
added: "8.0",
deprecated: null,
removed: null,
resources: [
{
name: "str_ends_with (php.net)",
url: "https://www.php.net/manual/en/function.str-ends-with.php",
},
],
},
{
name: "Throw expression",
description:
"The <code>throw</code> keyword is an expression, therefore an exception can be thrown in any expression context.",
keywords: ["throw", "expression", "exceptions"],
added: "8.0",
deprecated: null,
removed: null,
resources: [
{
name: "Exceptions (php.net)",
url: "https://www.php.net/manual/en/language.exceptions.php",
},
{
name: "RFC (php.net)",
url: "https://wiki.php.net/rfc/throw_expression",
},
],
},
{
name: "Typed properties",
description: "Class properties now support type declarations.",
keywords: ["properties", "class", "types", "typehints"],
added: "7.4",
deprecated: null,
removed: null,
resources: [
{
name: "Typed properties in PHP 7.4 (stitcher.io)",
url: "https://stitcher.io/blog/typed-properties-in-php-74",
},
],
},
{
name: "Arrow functions",
description:
"Arrow functions are a shorthand for anonymous functions: <code>fn (argument_list) => expr</code>.",
keywords: ["closures", "anonymous", "shorthand", "short"],
added: "7.4",
deprecated: null,
removed: null,
resources: [
{
name: "Arrow functions (php.net)",
url: "https://www.php.net/manual/en/functions.arrow.php",
},
],
},
{
name: "Anonymous classes",
description:
"Anonymous classes can be created with <code>new class</code>. They're used for throw away objects.",
keywords: ["closures", "anonymous", "class"],
added: "7.0",
deprecated: null,
removed: null,
resources: [
{
name: "Anonymous classes (php.net)",
url: "https://www.php.net/manual/en/migration70.new-features.php#migration70.new-features.anonymous-classes",
},
],
},
{
name: "Array unpacking (numeric keys only)",
description: "e.g. <code>$result = [0, …$arrayA, …$arrayB, 6, 7];</code>",
keywords: ["spread", "unpacking", "arrays", "deconstruct"],
added: "7.4",
deprecated: null,
removed: null,
resources: [
{
name: "RFC (php.net)",
url: "https://wiki.php.net/rfc/spread_operator_for_array",
},
],
},
{
name: "Underscore as numeric separator",
description:
'An underscore "<code>_</code>" can be used in numeric literals to visually separate groups of digits.',
keywords: ["numbers", "underscore", "literals"],
added: "7.4",
deprecated: null,
removed: null,
resources: [
{
name: "Integers (php.net)",
url: "https://www.php.net/manual/en/language.types.integer.php",
},
{
name: "RFC (php.net)",
url: "https://wiki.php.net/rfc/numeric_literal_separator",
},
],
},
{
name: "Filtered unserialize()",
description:
'Filtered unserialize allows developers to specify which classes they expect data to unserialize into. For example: <code>$data = unserialize($foo, ["allowed_classes" => ["MyClass", "MyClass2"]]);</code>. This improves security greatly when using PHP serialization.',
keywords: ["unserialize", "security", "serialize"],
added: "7.0",
deprecated: null,
removed: null,
resources: [
{
name: "PHP 7 New features page (php.net)",
url: "https://www.php.net/manual/en/migration70.new-features.php#migration70.new-features.filtered-unserialize",
},
{
name: "Unserialize manual page (php.net)",
url: "https://www.php.net/manual/en/function.unserialize.php",
},
],
},
{
name: "Splat operator / argument unpacking (... operator)",
description:
"The ... operator, aka the splat operator or array unpacking operator",
keywords: ["spread", "unpacking", "arrays", "splat"],
added: "5.6",
deprecated: null,
removed: null,
resources: [
{
name: "Argument unpacking via ...",
url: "https://www.php.net/manual/en/migration56.new-features.php#migration56.new-features.splat",
},
],
},
{
name: "Multi catch exception handline",
description:
"A catch block may specify multiple exceptions using the pipe (|) character",
keywords: ["exceptions"],
added: "7.1",
deprecated: null,
removed: null,
resources: [
{
name: "Exceptions (php.net)",
url: "https://www.php.net/manual/en/language.exceptions.php",
},
],
},
{
name: "nullable type declarations",
description:
"Type declarations can be marked nullable by prefixing the type name with a question mark (?). This signifies that the value can be of the specified type or null.",
keywords: ["declarations", "typehints", "return"],
added: "7.1",
deprecated: null,
removed: null,
resources: [
{
name: "Nullable type (php.net)",
url: "https://www.php.net/manual/en/language.types.declarations.php#language.types.declarations.nullable",
},
],
},
{
name: "void return type",
description:
"<code>void</code> is a return type indicating the function does not return a value.",
keywords: ["declarations", "typehints", "return"],
added: "7.1",
deprecated: null,
removed: null,
resources: [
{
name: "void return type (php.net)",
url: "https://www.php.net/manual/en/language.types.declarations.php#language.types.declarations.return-only",
},
],
},
{
name: "Group use declarations",
description:
"Classes, functions and constants being imported from the same namespace can be grouped together in a single use statement.",
keywords: ["imports"],
added: "7.0",
deprecated: null,
removed: null,
resources: [
{
name: "Group use declarations (php.net)",
url: "https://www.php.net/manual/en/language.namespaces.importing.php#language.namespaces.importing.group",
},
],
},
{
name: "Null coalescing operator",
description: "Use <code>??</code>",
keywords: ["short", "shorthand", "null", "conditional", "operators"],
added: "7.0",
deprecated: null,
removed: null,
resources: [
{
name: "Null coalescing operator (php.net)",
url: "https://www.php.net/manual/en/language.operators.comparison.php#language.operators.comparison.coalesce",
},
],
},
{
name: "Return type declarations",
description:
"Return type declarations specify the type of the value that will be returned from a function",
keywords: ["typehints", "types"],
added: "7.0",
deprecated: null,
removed: null,
resources: [
{
name: "Return type declarations (php.net)",
url: "https://www.php.net/manual/en/migration70.new-features.php#migration70.new-features.return-type-declarations",
},
],
},
{
name: "Spaceship operator",
description: "Use <code><=></code> for comparisons for sorting",
keywords: [
"short",
"shorthand",
"spaceship",
"space ship",
"comparisons",
"operators",
"sorting",
],
added: "7.0",
deprecated: null,
removed: null,
resources: [
{
name: "Spaceship operator (stitcher.io)",
url: "https://stitcher.io/blog/shorthand-comparisons-in-php#spaceship-operator",
},
],
},
{
name: "Scalar type hints",
description:
"As of PHP 7, the scalar types (integers, floating point numbers, booleans and strings) can be used as type hints. This is in addition to being able to use classes, arrays and callables, which were already allowed.",
keywords: ["types", "typehints", "typed"],
added: "7.0",
deprecated: null,
removed: null,
resources: [
{
name: "What is new in PHP 7?",
url: "https://trimurtidev.in/what-is-new-in-php-7/",
},
],
},
{
name: "Shorthand Ternary (?:)",
description: "Use of <code>?:</code> - actually added in PHP v5.3!",
keywords: ["short", "shorthand", "ternary", "conditional", "operators"],
added: "5.6",
deprecated: null,
removed: null,
resources: [
{
name: "Shorthand ternary (stitcher.io)",
url: "https://stitcher.io/blog/shorthand-comparisons-in-php#shorthand-ternary-operator",
},
],
},
{
name: "get_magic_quotes_gpc",
description: "Gets the current configuration setting of magic_quotes_gpc",
keywords: ["functions", "deprecated", "removed"],
added: "0.0",
deprecated: "7.4",
removed: "8.0",
resources: [
{
name: "get_magic_quotes_gpc (php.net)",
url: "https://www.php.net/manual/en/function.get-magic-quotes-gpc.php",
},
],
},
{
name: "FILTER_FLAG_SCHEME_REQUIRED constant",
description:
"Filter flag for `filter_var()` for use with `FILTER_VALIDATE_URL`",
keywords: [
"filters",
"constants",
"deprecated",
"removed",
"urls",
"validation",
],
added: "0.0",
deprecated: "7.3.0",
removed: "8.0",
resources: [
{
name: "Validate filters (php.net)",
url: "https://www.php.net/manual/en/filter.filters.validate.php",
},
{
name: "Filter flags (php.net)",
url: "https://www.php.net/manual/en/filter.filters.flags.php",
},
],
},
{
name: "FILTER_FLAG_HOST_REQUIRED constant",
description:
"Filter flag for `filter_var()` for use with `FILTER_VALIDATE_URL`",
keywords: [
"filters",
"constants",
"deprecated",
"removed",
"urls",
"validation",
],
added: "0.0",
deprecated: "7.3.0",
removed: "8.0",
resources: [
{
name: "Validate filters (php.net)",
url: "https://www.php.net/manual/en/filter.filters.validate.php",
},
{
name: "Filter flags (php.net)",
url: "https://www.php.net/manual/en/filter.filters.flags.php",
},
],
},
];