|
| 1 | +<?php |
| 2 | + |
| 3 | +use function releases\php85\common_header;use function releases\php85\language_chooser;use function releases\php85\message; |
| 4 | + |
| 5 | +if (!isset($lang)) { |
| 6 | + $lang = 'en'; |
| 7 | +} |
| 8 | +if (!isset($documentation)) { |
| 9 | + $documentation = $lang; |
| 10 | +} |
| 11 | + |
| 12 | +$_SERVER['BASE_PAGE'] = 'releases/8.5/' . $lang . '.php'; |
| 13 | + |
| 14 | +include_once __DIR__ . '/common.php'; |
| 15 | + |
| 16 | +common_header(message('common_header', $lang)); |
| 17 | + |
| 18 | +?> |
| 19 | + <section class="php8-section php8-section_dark php8-section_header center"> |
| 20 | + <div class="page-tools"> |
| 21 | + <div class="change-language"> |
| 22 | + <?php language_chooser($lang); ?> |
| 23 | + </div> |
| 24 | + </div> |
| 25 | + <div class="php8-section__content"> |
| 26 | + <div class="php8-logo"> |
| 27 | + <img src="/images/php8/logo_php8_5.svg" alt="PHP 8.5" height="126" width="343"> |
| 28 | + </div> |
| 29 | + <div class="php8-title"><?= message('main_title', $lang) ?></div> |
| 30 | + <div class="php8-subtitle"><?= message('main_subtitle', $lang) ?></div> |
| 31 | + <div class="php8-button-wrapper center"> |
| 32 | + <a class="php8-button php8-button_light" href="/downloads"><?= message('upgrade_now', $lang) ?></a> |
| 33 | + </div> |
| 34 | + </div> |
| 35 | + </section> |
| 36 | + |
| 37 | + <section class="php8-section center"> |
| 38 | + <div class="php8-compare"> |
| 39 | + <h2 class="php8-h2" id="property_hooks"> |
| 40 | + <?= message('pipe_operator_title', $lang) ?> |
| 41 | + <a class="php8-rfc" href="https://wiki.php.net/rfc/pipe-operator-v3">RFC</a> |
| 42 | + </h2> |
| 43 | + <div class="php8-compare__main"> |
| 44 | + <div class="php8-compare__block example-contents"> |
| 45 | + <div class="php8-compare__label">PHP < 8.5</div> |
| 46 | + <div class="php8-code phpcode"> |
| 47 | + <?php highlight_php_trimmed( |
| 48 | + <<<'PHP' |
| 49 | +$input = ' Some kind of string. '; |
| 50 | +
|
| 51 | +$output = strtolower( |
| 52 | + str_replace(['.', '/', '…'], '', |
| 53 | + str_replace(' ', '-', |
| 54 | + trim($input) |
| 55 | + ) |
| 56 | + ) |
| 57 | +); |
| 58 | +PHP |
| 59 | + |
| 60 | + ); ?> |
| 61 | + </div> |
| 62 | + </div> |
| 63 | + <div class="php8-compare__arrow"></div> |
| 64 | + <div class="php8-compare__block example-contents" style="display: table;"> |
| 65 | + <div class="php8-compare__label php8-compare__label_new">PHP 8.5</div> |
| 66 | + <div class="php8-code phpcode" style="display: table-cell;"> |
| 67 | + <?php highlight_php_trimmed( |
| 68 | + <<<'PHP' |
| 69 | +$input = ' Some kind of string. '; |
| 70 | +
|
| 71 | +$output = $input |
| 72 | + |> trim(...) |
| 73 | + |> fn (string $string) => str_replace(' ', '-', $string) |
| 74 | + |> fn (string $string) => str_replace(['.', '/', '…'], '', $string) |
| 75 | + |> strtolower(...); |
| 76 | +PHP |
| 77 | + ); ?> |
| 78 | + </div> |
| 79 | + </div> |
| 80 | + </div> |
| 81 | + </div> |
| 82 | + |
| 83 | + <div class="php8-compare"> |
| 84 | + <h2 class="php8-h2" id="property_hooks"> |
| 85 | + <?= message('url_parsing_api_title', $lang) ?> |
| 86 | + <a class="php8-rfc" href="https://wiki.php.net/rfc/url_parsing_api">RFC</a> |
| 87 | + </h2> |
| 88 | + <div class="php8-compare__main"> |
| 89 | + <div class="php8-compare__block example-contents"> |
| 90 | + <div class="php8-compare__label">PHP < 8.5</div> |
| 91 | + <div class="php8-code phpcode"> |
| 92 | + <?php highlight_php_trimmed( |
| 93 | + <<<'PHP' |
| 94 | +$components = parse_url("https://php.net/releases/8.5/en.php"); |
| 95 | +
|
| 96 | +var_dump($components['host']); // string(7) "php.net" |
| 97 | +PHP |
| 98 | + |
| 99 | + ); ?> |
| 100 | + </div> |
| 101 | + </div> |
| 102 | + <div class="php8-compare__arrow"></div> |
| 103 | + <div class="php8-compare__block example-contents" style="display: table;"> |
| 104 | + <div class="php8-compare__label php8-compare__label_new">PHP 8.5</div> |
| 105 | + <div class="php8-code phpcode" style="display: table-cell;"> |
| 106 | + <?php highlight_php_trimmed( |
| 107 | + <<<'PHP' |
| 108 | +$uri = new Uri\Rfc3986\Uri("https://php.net/releases/8.5/en.php"); |
| 109 | +
|
| 110 | +var_dump($uri->getHost()); // string(7) "php.net" |
| 111 | +PHP |
| 112 | + ); ?> |
| 113 | + </div> |
| 114 | + </div> |
| 115 | + </div> |
| 116 | + <div class="php8-compare__content"> |
| 117 | + <?= message('url_parsing_api_description', $lang) ?> |
| 118 | + </div> |
| 119 | + </div> |
| 120 | + </section> |
| 121 | + |
| 122 | + <section class="php8-section center php8-section_light php8-columns"> |
| 123 | + <div class="php8-column"> |
| 124 | + <h2 class="php8-h2" id="other_new_things"><?= message('new_classes_title', $lang) ?></h2> |
| 125 | + <div class="php8-compare__content php8-compare__content--block"> |
| 126 | + <ul> |
| 127 | + |
| 128 | + </ul> |
| 129 | + </div> |
| 130 | + </div> |
| 131 | + |
| 132 | + <div class="php8-column"> |
| 133 | + <h2 class="php8-h2" id="deprecations_and_bc_breaks"><?= message('bc_title', $lang) ?></h2> |
| 134 | + <div class="php8-compare__content"> |
| 135 | + <ul> |
| 136 | + |
| 137 | + </ul> |
| 138 | + </div> |
| 139 | + </div> |
| 140 | + </section> |
| 141 | + |
| 142 | + <section class="php8-section php8-section_dark php8-section_footer php8-footer"> |
| 143 | + <div class="php8-section__content"> |
| 144 | + <h2 class="php8-h2 center"><?= message('footer_title', $lang) ?></h2> |
| 145 | + <div class="php8-button-wrapper center"> |
| 146 | + <a class="php8-button php8-button_light" href="/downloads"><?= message('upgrade_now', $lang) ?></a> |
| 147 | + </div> |
| 148 | + <div class="php8-footer__content"><?= message('footer_description', $lang) ?></div> |
| 149 | + </div> |
| 150 | + </section> |
| 151 | + |
| 152 | +<?php |
| 153 | + |
| 154 | +site_footer(); |
0 commit comments