{"id":1607,"date":"2021-05-29T22:05:37","date_gmt":"2021-05-29T19:05:37","guid":{"rendered":"https:\/\/www.etemkeskin.com\/?p=1607"},"modified":"2021-05-29T22:55:47","modified_gmt":"2021-05-29T19:55:47","slug":"php-8-gelen-yeni-ozellikler","status":"publish","type":"post","link":"https:\/\/www.etemkeskin.com\/index.php\/tr\/2021\/05\/29\/php-8-gelen-yeni-ozellikler\/","title":{"rendered":"PHP 8 Gelen Yeni \u00d6zellikler"},"content":{"rendered":"\n<p>Y\u0131llar i\u00e7inde PHP&#8217; ye bir \u00e7ok yeni \u00f6zellik geldi. Yeni gelen bu \u00f6zelliklerle birlikte PHP daha g\u00fc\u00e7l\u00fc, modern, stabil ve daha h\u0131zl\u0131 bir dil haline geldi. Bu yaz\u0131da <strong>PHP 8<\/strong> \u0130le gelen yeni \u00f6zellikleri anlataca\u011f\u0131m. PHP 8 versiyonu, <strong>26 Kas\u0131m 2020<\/strong> tarihinde kullan\u0131ma sunuldu.<\/p>\n\n\n\n<h3>1- JIT Derleyici<\/h3>\n\n\n\n<p>PHP 8 ile gelen en dikkat \u00e7eken yenilik<strong> JIT (just in time) <\/strong>derleyicidir(compiler). PHP 8 iki JIT derleme motoru sunar. Tracing JIT daha \u00fcst\u00fcn \u00f6zelli\u011fe sahiptir.<\/p>\n\n\n\n<p>JIT, OPcache&#8217; in nerdeyse ba\u011f\u0131ms\u0131z bir par\u00e7as\u0131 olarak implemente edildi. JIT \u00e7al\u0131\u015fma mekanizmas\u0131; kodun monit\u00f6r edilerek s\u0131k kullan\u0131lan b\u00f6l\u00fcmlerin bytcode olarak derlenmesi ve \u00e7al\u0131\u015fma an\u0131nda bu derlenmi\u015f k\u0131s\u0131mlar\u0131n \u00e7al\u0131\u015ft\u0131r\u0131lmas\u0131d\u0131r. <\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" width=\"668\" height=\"507\" src=\"https:\/\/www.etemkeskin.com\/wp-content\/uploads\/2021\/05\/image-9.png\" alt=\"\" class=\"wp-image-1588\"\/><figcaption>PHP 8 performans metrikleri (kinsta.com)<\/figcaption><\/figure>\n\n\n\n<p>JIT, OPcache&#8217; in bir par\u00e7as\u0131 oldu\u011fu i\u00e7in <strong>OPcache<\/strong>&#8216; in etkinle\u015ftirilmesi gerekir.Bunun i\u00e7in&nbsp;<code>php.ini<\/code>&nbsp;dosyas\u0131nda&nbsp;<code>opcache.enable=1<\/code>&nbsp;olarak ayarlamam\u0131z gerekiyor. Daha sonra JIT&#8217; i aktifle\u015ftirmek i\u00e7in &nbsp;<code>opcache.jit_buffer_size=1024M<\/code>&nbsp;\u015feklinde bellek ay\u0131rmam\u0131z gerekmektedir. Bunun varsay\u0131lan de\u011feri 0, yani<strong> JIT compiler <\/strong>devre d\u0131\u015f\u0131 olarak gelmektedir. Etkin olup olmad\u0131\u011f\u0131ndan emin olam\u0131yorsan\u0131z&nbsp;<a rel=\"noreferrer noopener\" href=\"https:\/\/www.php.net\/manual\/en\/function.opcache-get-status.php\" target=\"_blank\"><code>opcache_get_status<\/code><\/a>&nbsp;fonksiyonunu kullanarak kontrol edebilirsiniz.<\/p>\n\n\n\n<h3>2- \u00c7oklu Tip Tan\u0131mlama(Union Types)<\/h3>\n\n\n\n<p>PHP 8 ile birlikte de\u011fi\u015fkenlerde, fonksiyonlarda ki parametre tan\u0131mlamalar\u0131nda ve fonksiyon d\u00f6n\u00fc\u015f tipi tan\u0131mlamalar\u0131nda <strong>\u00e7oklu tip tan\u0131mlamas\u0131na<\/strong> izin veriyor.<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;mode&quot;:&quot;php&quot;,&quot;mime&quot;:&quot;text\/x-php&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;showPanel&quot;:false,&quot;language&quot;:&quot;PHP&quot;,&quot;modeName&quot;:&quot;php&quot;}\">class Product\n{\n    protected int|float $price; \n  \n    public function setPrice(int|float $price): void \n    {\n        $this-&gt;price = $price;\n    }\n    public function getPrice(): int|float \n    {\n        return $this-&gt;price;\n    }\n}<\/pre><\/div>\n\n\n\n<h3>3- Nullsafe Operat\u00f6r\u00fc<\/h3>\n\n\n\n<p>Null safe operat\u00f6r\u00fc ile zincir metodlar\u0131nda <strong>null <\/strong>kontrol\u00fc <strong>?<\/strong> operat\u00f6r\u00fc ile birlikte daha kolay kontrol edebiliriz. E\u011fer bir<strong> metod null<\/strong> de\u011fer d\u00f6nd\u00fcr\u00fcrse i\u015flem durduruluyor.<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;mode&quot;:&quot;php&quot;,&quot;mime&quot;:&quot;text\/x-php&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;showPanel&quot;:false,&quot;language&quot;:&quot;PHP&quot;,&quot;modeName&quot;:&quot;php&quot;}\">$country = $session?-&gt;user?-&gt;getAddress()?-&gt;country;<\/pre><\/div>\n\n\n\n<h3>4- E\u015fle\u015fme \u0130fadesi (Match Expression)<\/h3>\n\n\n\n<p>PHP 8,<strong> swich case<\/strong> ifadesinin daha k\u0131sa ve daha basit bir yap\u0131s\u0131 <strong>match<\/strong> ifadesi ile birlikte geliyor. \u0130\u015flem sonucu bir de\u011fi\u015fkene atanabilir veya geri d\u00f6nd\u00fcr\u00fclen de\u011fer kullan\u0131labilinir.<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;mode&quot;:&quot;php&quot;,&quot;mime&quot;:&quot;text\/x-php&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;showPanel&quot;:false,&quot;language&quot;:&quot;PHP&quot;,&quot;modeName&quot;:&quot;php&quot;}\">\/* PHP 8 *\/\nswitch (8.0) {\n  case '8.0':\n    $result = &quot;Oh no!&quot;;\n    break;\n  case 8.0:\n    $result = &quot;This is what I expected&quot;;\n    break;\n}\necho $result; \n\/\/\u00c7IKTI: Oh no!\n\/* PHP 8 *\/\necho match (8.0) {\n  '8.0' =&gt; &quot;Oh no!&quot;,\n  8.0 =&gt; &quot;This is what I expected&quot;,\n};\n\/\/\u00c7IKTI: This is what I expected<\/pre><\/div>\n\n\n\n<h3>5- Metin ve Say\u0131 \u0130fadelerin Kar\u015f\u0131la\u015ft\u0131r\u0131lmas\u0131<\/h3>\n\n\n\n<p>PHP 8&#8242; de e\u011fer say\u0131sal de\u011fer bir metinle kar\u015f\u0131la\u015ft\u0131r\u0131l\u0131yorsa say\u0131sal de\u011fer metne \u00e7evrilerek kar\u015f\u0131la\u015ft\u0131r\u0131l\u0131r. PHP8&#8242; de, <strong>PHP7<\/strong> de olan <strong>0<\/strong> de\u011ferinin <strong>&#8220;&#8221;<\/strong> bo\u015f string kabul edilmesi veya<strong> 123 == &#8220;123abc&#8221;<\/strong> kar\u015f\u0131la\u015ft\u0131rmas\u0131n\u0131n<strong> false<\/strong> yerine<strong> true<\/strong> de\u011fer d\u00f6nd\u00fcrmesi gibi tutars\u0131zl\u0131klar\u0131n \u00f6n\u00fcne ge\u00e7iliyor. <\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;mode&quot;:&quot;php&quot;,&quot;mime&quot;:&quot;text\/x-php&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;showPanel&quot;:false,&quot;language&quot;:&quot;PHP&quot;,&quot;modeName&quot;:&quot;php&quot;}\">PHP7\n0 == 'foobar' \/\/ true\n\nPHP8\n0 == 'foobar' \/\/ false<\/pre><\/div>\n\n\n\n<h3>6- \u0130simlendirilmi\u015f Arg\u00fcmanlar(<strong>Named Arguments<\/strong>)<\/h3>\n\n\n\n<p>Bir metod ya da fonksiyonun zorunlu parametrelerini belirtip opsiyonel olanlar\u0131 atlayabiliyoruz.  \u00d6rne\u011fin 9 tane parametre alan bir fonksiyonda ilk 2 parametre zorunlu di\u011ferleri opsiyonel olsun.  E\u011fer opsiyonel olan parametrelerden sadece 9. olana de\u011fer g\u00f6ndermek istersek fonksiyona g\u00f6nderilecek de\u011feri ismi ile birlikte g\u00f6nderiyoruz.<\/p>\n\n\n\n<p>Ayr\u0131ca g\u00f6nderilecek parametreleri isimleri ile tan\u0131mlarsak istedi\u011fimiz s\u0131rada g\u00f6nderebiliriz.<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;mode&quot;:&quot;php&quot;,&quot;mime&quot;:&quot;text\/x-php&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;showPanel&quot;:false,&quot;language&quot;:&quot;PHP&quot;,&quot;modeName&quot;:&quot;php&quot;}\">function foo(string $a, string $b, ?string $c = null, ?string $d = null) \n{ \/* \u2026 *\/ }\n\nfoo(\n    b: 'value b', \n    a: 'value a', \n    d: 'value d',\n);<\/pre><\/div>\n\n\n\n<h3>7- Yap\u0131c\u0131 De\u011fi\u015fkenlerin Tan\u0131mlanmas\u0131 (<strong>Constructor property promotion<\/strong>)<\/h3>\n\n\n\n<p>PHP 8 ile birlikte bir s\u0131n\u0131f\u0131n de\u011fi\u015fkenlerine yap\u0131c\u0131(constructor) metod ile de\u011fer atamak daha kolay. <\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;mode&quot;:&quot;php&quot;,&quot;mime&quot;:&quot;text\/x-php&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;showPanel&quot;:false,&quot;language&quot;:&quot;PHP&quot;,&quot;modeName&quot;:&quot;php&quot;}\">\/*PHP 7*\/\nclass Point {\n  public float $x;\n  public float $y;\n\n  public function __construct(float $x = 0.0, float $y = 0.0) {\n    $this-&gt;x = $x;\n    $this-&gt;y = $y;\n  }\n}\n\/*PHP 8*\/\nclass Point {\n  public function __construct(\n    public float $x = 0.0,\n    public float $y = 0.0,\n  ) {}\n}<\/pre><\/div>\n\n\n\n<h3>7- <strong>Attributes<\/strong> V2<\/h3>\n\n\n\n<p><strong>Java&#8217; da annotation, JavaScript ve python &#8216;da decorator <\/strong>olarak adland\u0131r\u0131lan  ve s\u0131n\u0131flara, metodlara, fonksiyonlara ve de\u011fi\u015fkenlere <strong>meta verisi<\/strong> tan\u0131mlamak i\u00e7in kullan\u0131lan bir \u00f6zellik art\u0131k PHP8 &#8216;de de bulunuyor.<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;mode&quot;:&quot;php&quot;,&quot;mime&quot;:&quot;text\/x-php&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;showPanel&quot;:false,&quot;language&quot;:&quot;PHP&quot;,&quot;modeName&quot;:&quot;php&quot;}\">&lt;&lt;ExampleAttribute&gt;&gt;\nclass Foo\n{\n\t&lt;&lt;ExampleAttribute&gt;&gt;\n\tpublic const FOO = 'foo';\n\n\t&lt;&lt;ExampleAttribute&gt;&gt;\n\tpublic $x;\n\n\t&lt;&lt;ExampleAttribute&gt;&gt;\n\tpublic function foo(&lt;&lt;ExampleAttribute&gt;&gt; $bar) { }\n}\n\n$object = new &lt;&lt;ExampleAttribute&gt;&gt; class () { };\n\n&lt;&lt;ExampleAttribute&gt;&gt;\nfunction f1() { }\n\n$f2 = &lt;&lt;ExampleAttribute&gt;&gt; function () { };\n\n$f3 = &lt;&lt;ExampleAttribute&gt;&gt; fn () =&gt; 1;<\/pre><\/div>\n\n\n\n<h3>8- Dahili Fonksiyonlar i\u00e7in Tutarl\u0131 Tip Hatalar\u0131(<strong>Consistent type errors for internal functions<\/strong>)<\/h3>\n\n\n\n<p>PHP fonksiyonlar\u0131 art\u0131k daha tutarl\u0131 hata mesajlar\u0131 veriyor.<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;mode&quot;:&quot;php&quot;,&quot;mime&quot;:&quot;text\/x-php&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;showPanel&quot;:false,&quot;language&quot;:&quot;PHP&quot;,&quot;modeName&quot;:&quot;php&quot;}\">\/**PHP 7*\/\nstrlen([]); \/\/ Warning: strlen() expects parameter 1 to be string, array given\n\/*PHP 8*\/\nstrlen([]); \/\/ TypeError: strlen(): Argument #1 ($str) must be of type string, array given<\/pre><\/div>\n\n\n\n<h3>9- Di\u011fer \u00d6zellikler<\/h3>\n\n\n\n<p class=\"has-text-color has-very-dark-gray-color\"><strong>str_contains()<\/strong> : Bir string ifadenin i\u00e7inde ba\u015fka bir string ifade bulunup bulunmad\u0131\u011f\u0131n\u0131 kontrol eder <code>boolean<\/code>&nbsp;de\u011fer d\u00f6nd\u00fcr\u00fcr. <\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;mode&quot;:&quot;php&quot;,&quot;mime&quot;:&quot;text\/x-php&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;showPanel&quot;:false,&quot;language&quot;:&quot;PHP&quot;,&quot;modeName&quot;:&quot;php&quot;}\">str_contains ( string $haystack , string $needle ) :\nstr_contains(&quot;PHP is awesome&quot;, &quot;PHP&quot;) \/\/ \u00c7\u0131kt\u0131 : true <\/pre><\/div>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<p><strong>str_starts_with()<\/strong> :Bir string ifade i\u00e7inde ba\u015fka bir string ifade ile ba\u015flay\u0131p ba\u015flamad\u0131\u011f\u0131n\u0131 kontrol eder <code>boolean<\/code>&nbsp;de\u011fer d\u00f6nd\u00fcr\u00fcr.<\/p>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<p><strong>str_ends_with()<\/strong>: Bir string ifade i\u00e7inde ba\u015fka bir string ifade ile bitip bitmedi\u011fini kontrol eder <code>boolean<\/code>&nbsp;de\u011fer d\u00f6nd\u00fcr\u00fcr.<\/p>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<p><strong>get_debug_type()<\/strong>: get_debug_type()&nbsp;daha \u00f6nceden kulland\u0131\u011f\u0131m\u0131z&nbsp;<strong>gettype()<\/strong>&nbsp;ile ayn\u0131 i\u015fi yap\u0131p bize de\u011fi\u015fkenin t\u00fcr\u00fcn\u00fc d\u00f6nd\u00fcr\u00fcyor<\/p>\n\n\n\n<p>A\u015fa\u011f\u0131daki tablo incelendi\u011finde aras\u0131ndaki farklar daha net anla\u015f\u0131lacakt\u0131r.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>Tip<\/th><th>\u00d6rnek De\u011fer<\/th><th><code>gettype<\/code><\/th><th><code>get_debug_type<\/code><\/th><\/tr><\/thead><tbody><tr><td>Integer<\/td><td><code>123<\/code><\/td><td><code>integer<\/code><\/td><td><code>int<\/code><\/td><\/tr><tr><td>Float<\/td><td><code>3.14<\/code><\/td><td><code>double<\/code><\/td><td><code>float<\/code><\/td><\/tr><tr><td>Boolean<\/td><td><code>true<\/code><\/td><td><code>boolean<\/code><\/td><td><code>bool<\/code><\/td><\/tr><tr><td>Boolean<\/td><td><code>false<\/code><\/td><td><code>boolean<\/code><\/td><td><code>bool<\/code><\/td><\/tr><tr><td>String<\/td><td><code>'Foo'<\/code><\/td><td><code>string<\/code><\/td><td><code>string<\/code><\/td><\/tr><tr><td>Array<\/td><td><code>[1, 2, 3]<\/code><\/td><td><code>array<\/code><\/td><td><code>array<\/code><\/td><\/tr><tr><td>Null<\/td><td><code>null<\/code><\/td><td><code>NULL<\/code><\/td><td><code>null<\/code><\/td><\/tr><tr><td>S\u0131n\u0131f<\/td><td><code>new Foo\\Bar()<\/code><\/td><td><code>object<\/code><\/td><td><code>Foo\\Bar<\/code><\/td><\/tr><tr><td>S\u0131n\u0131f<\/td><td><code>new DateTime()<\/code><\/td><td><code>object<\/code><\/td><td><code>DateTime<\/code><\/td><\/tr><tr><td>Anonim S\u0131n\u0131f<\/td><td><code>new class {}<\/code><\/td><td><code>object<\/code><\/td><td><code>class@anonymous<\/code><\/td><\/tr><tr><td>Anonim S\u0131n\u0131f<\/td><td><code>new class extends Foo {}<\/code><\/td><td><code>object<\/code><\/td><td><code>Foo@anonymous<\/code><\/td><\/tr><tr><td>Closure<\/td><td><code>function() {}<\/code><\/td><td><code>object<\/code><\/td><td><code>Closure<\/code><\/td><\/tr><tr><td>Stream<\/td><td><code>tmpfile()<\/code><\/td><td><code>resource<\/code><\/td><td><code>resource (stream)<\/code><\/td><\/tr><tr><td>Curl<\/td><td><code>curl_init()<\/code><\/td><td><code>resource<\/code><\/td><td><code>resource (curl)<\/code><\/td><\/tr><tr><td>Xml<\/td><td><code>xml_parser_create()<\/code><\/td><td><code>resource<\/code><\/td><td><code>resource (xml)<\/code><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<p><strong>fdiv()<\/strong> : Bu fonksiyon <strong>s\u0131f\u0131ra b\u00f6lmeye<\/strong> izin veriyor<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;mode&quot;:&quot;php&quot;,&quot;mime&quot;:&quot;text\/x-php&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;showPanel&quot;:false,&quot;language&quot;:&quot;PHP&quot;,&quot;modeName&quot;:&quot;php&quot;}\">fdiv(1, 0); \/\/ float(INF)\nfdiv(-1, 0); \/\/ float(-INF)<\/pre><\/div>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<p><strong>mixed type :<\/strong>  PHP8&#8242; de<strong> mixed<\/strong> t\u00fcr\u00fcnde tip tan\u0131mlamas\u0131 yap\u0131labiliniyor ve a\u015fa\u011f\u0131daki tiplerin yerine ge\u00e7iyor.<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;mode&quot;:&quot;php&quot;,&quot;mime&quot;:&quot;text\/x-php&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;showPanel&quot;:false,&quot;language&quot;:&quot;PHP&quot;,&quot;modeName&quot;:&quot;php&quot;}\">array|bool|callable|int|float|null|object|resource|string\npublic function foo(mixed $value) {}<\/pre><\/div>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<p><strong>parametre listelerinde sonda virg\u00fcl: <\/strong>Bir fonksiyon tan\u0131mlarken son parametreye virg\u00fcl konulabiliniyor.<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;mode&quot;:&quot;php&quot;,&quot;mime&quot;:&quot;text\/x-php&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;showPanel&quot;:false,&quot;language&quot;:&quot;PHP&quot;,&quot;modeName&quot;:&quot;php&quot;}\">public function foo(\n\t\tstring $x,\n\t\tfloat $z, \/\/ trailing comma\n\t) {\n\t\t\/\/ do something\n\t}<\/pre><\/div>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<p><strong>::class obje \u00fczerinde kullanma :<\/strong> Daha \u00f6nce <strong>get_class()<\/strong> \u015feklinde olan kullan\u0131m art\u0131k<strong> $foo::class<\/strong> ile de m\u00fcmk\u00fcn ve ayn\u0131 sonucu veriyor..<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;mode&quot;:&quot;php&quot;,&quot;mime&quot;:&quot;text\/x-php&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;showPanel&quot;:false,&quot;language&quot;:&quot;PHP&quot;,&quot;modeName&quot;:&quot;php&quot;}\">$foo = new Foo();\n\nvar_dump($foo::class);<\/pre><\/div>\n\n\n\n<p>Ba\u015far\u0131lar &#8230;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Y\u0131llar i\u00e7inde PHP&#8217; ye bir \u00e7ok yeni \u00f6zellik geldi. Yeni gelen bu \u00f6zelliklerle birlikte PHP daha g\u00fc\u00e7l\u00fc, modern, stabil ve daha h\u0131zl\u0131 bir dil haline geldi. Bu yaz\u0131da PHP 8 \u0130le gelen yeni \u00f6zellikleri anlataca\u011f\u0131m. PHP 8 versiyonu, 26 Kas\u0131m 2020 tarihinde kullan\u0131ma sunuldu. 1- JIT Derleyici PHP 8 ile gelen en dikkat \u00e7eken yenilik [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[28],"tags":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v16.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>PHP 8 Gelen Yeni \u00d6zellikler - blog website<\/title>\n<meta name=\"description\" content=\"Y\u0131llar i\u00e7inde PHP&#039; ye bir \u00e7ok yeni \u00f6zellik geldi. Yeni gelen bu \u00f6zelliklerle birlikte PHP daha g\u00fc\u00e7l\u00fc, modern, stabil ve daha h\u0131zl\u0131 bir dil haline geldi. Bu yaz\u0131da PHP 8 \u0130le gelen yeni \u00f6zellikleri anlataca\u011f\u0131m. PHP 8 versiyonu, 26 Kas\u0131m 2020 tarihinde kullan\u0131ma sunuldu.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.etemkeskin.com\/index.php\/tr\/2021\/05\/29\/php-8-gelen-yeni-ozellikler\/\" \/>\n<meta property=\"og:locale\" content=\"tr_TR\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"PHP 8 Gelen Yeni \u00d6zellikler - blog website\" \/>\n<meta property=\"og:description\" content=\"Y\u0131llar i\u00e7inde PHP&#039; ye bir \u00e7ok yeni \u00f6zellik geldi. Yeni gelen bu \u00f6zelliklerle birlikte PHP daha g\u00fc\u00e7l\u00fc, modern, stabil ve daha h\u0131zl\u0131 bir dil haline geldi. Bu yaz\u0131da PHP 8 \u0130le gelen yeni \u00f6zellikleri anlataca\u011f\u0131m. PHP 8 versiyonu, 26 Kas\u0131m 2020 tarihinde kullan\u0131ma sunuldu.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.etemkeskin.com\/index.php\/tr\/2021\/05\/29\/php-8-gelen-yeni-ozellikler\/\" \/>\n<meta property=\"og:site_name\" content=\"blog website\" \/>\n<meta property=\"article:published_time\" content=\"2021-05-29T19:05:37+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-05-29T19:55:47+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.etemkeskin.com\/wp-content\/uploads\/2021\/05\/image-9.png\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Tahmini okuma s\u00fcresi\" \/>\n\t<meta name=\"twitter:data1\" content=\"6 dakika\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.etemkeskin.com\/#website\",\"url\":\"https:\/\/www.etemkeskin.com\/\",\"name\":\"blog website\",\"description\":\"Etem KESK\\u0130N\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":\"https:\/\/www.etemkeskin.com\/?s={search_term_string}\",\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"tr\"},{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/www.etemkeskin.com\/index.php\/tr\/2021\/05\/29\/php-8-gelen-yeni-ozellikler\/#primaryimage\",\"inLanguage\":\"tr\",\"url\":\"https:\/\/www.etemkeskin.com\/wp-content\/uploads\/2021\/05\/image-9.png\",\"contentUrl\":\"https:\/\/www.etemkeskin.com\/wp-content\/uploads\/2021\/05\/image-9.png\",\"width\":668,\"height\":507},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.etemkeskin.com\/index.php\/tr\/2021\/05\/29\/php-8-gelen-yeni-ozellikler\/#webpage\",\"url\":\"https:\/\/www.etemkeskin.com\/index.php\/tr\/2021\/05\/29\/php-8-gelen-yeni-ozellikler\/\",\"name\":\"PHP 8 Gelen Yeni \\u00d6zellikler - blog website\",\"isPartOf\":{\"@id\":\"https:\/\/www.etemkeskin.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.etemkeskin.com\/index.php\/tr\/2021\/05\/29\/php-8-gelen-yeni-ozellikler\/#primaryimage\"},\"datePublished\":\"2021-05-29T19:05:37+00:00\",\"dateModified\":\"2021-05-29T19:55:47+00:00\",\"author\":{\"@id\":\"https:\/\/www.etemkeskin.com\/#\/schema\/person\/dcbc30282861ce578b96a79ce8789629\"},\"description\":\"Y\\u0131llar i\\u00e7inde PHP' ye bir \\u00e7ok yeni \\u00f6zellik geldi. Yeni gelen bu \\u00f6zelliklerle birlikte PHP daha g\\u00fc\\u00e7l\\u00fc, modern, stabil ve daha h\\u0131zl\\u0131 bir dil haline geldi. Bu yaz\\u0131da PHP 8 \\u0130le gelen yeni \\u00f6zellikleri anlataca\\u011f\\u0131m. PHP 8 versiyonu, 26 Kas\\u0131m 2020 tarihinde kullan\\u0131ma sunuldu.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.etemkeskin.com\/index.php\/tr\/2021\/05\/29\/php-8-gelen-yeni-ozellikler\/#breadcrumb\"},\"inLanguage\":\"tr\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.etemkeskin.com\/index.php\/tr\/2021\/05\/29\/php-8-gelen-yeni-ozellikler\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.etemkeskin.com\/index.php\/tr\/2021\/05\/29\/php-8-gelen-yeni-ozellikler\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Ana sayfa\",\"item\":\"https:\/\/www.etemkeskin.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"PHP 8 Gelen Yeni \\u00d6zellikler\"}]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.etemkeskin.com\/#\/schema\/person\/dcbc30282861ce578b96a79ce8789629\",\"name\":\"etemkeskin\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/www.etemkeskin.com\/#personlogo\",\"inLanguage\":\"tr\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/6af0148b790691ed24ae245fb3dc773b?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/6af0148b790691ed24ae245fb3dc773b?s=96&d=mm&r=g\",\"caption\":\"etemkeskin\"},\"url\":\"https:\/\/www.etemkeskin.com\/index.php\/author\/etemkeskinyahoo-com\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","_links":{"self":[{"href":"https:\/\/www.etemkeskin.com\/index.php\/wp-json\/wp\/v2\/posts\/1607"}],"collection":[{"href":"https:\/\/www.etemkeskin.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.etemkeskin.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.etemkeskin.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.etemkeskin.com\/index.php\/wp-json\/wp\/v2\/comments?post=1607"}],"version-history":[{"count":4,"href":"https:\/\/www.etemkeskin.com\/index.php\/wp-json\/wp\/v2\/posts\/1607\/revisions"}],"predecessor-version":[{"id":1648,"href":"https:\/\/www.etemkeskin.com\/index.php\/wp-json\/wp\/v2\/posts\/1607\/revisions\/1648"}],"wp:attachment":[{"href":"https:\/\/www.etemkeskin.com\/index.php\/wp-json\/wp\/v2\/media?parent=1607"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.etemkeskin.com\/index.php\/wp-json\/wp\/v2\/categories?post=1607"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.etemkeskin.com\/index.php\/wp-json\/wp\/v2\/tags?post=1607"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}