{"id":1533,"date":"2021-05-29T22:49:32","date_gmt":"2021-05-29T19:49:32","guid":{"rendered":"https:\/\/www.etemkeskin.com\/?p=1533"},"modified":"2021-05-30T01:16:48","modified_gmt":"2021-05-29T22:16:48","slug":"php-8-new-features","status":"publish","type":"post","link":"https:\/\/www.etemkeskin.com\/index.php\/2021\/05\/29\/php-8-new-features\/","title":{"rendered":"PHP 8 New Features"},"content":{"rendered":"\n<p>Many new features have come to PHP over the years. With these new features, PHP has become a more powerful, modern, stable and faster language. In this post, I will explain the new features that come with PHP 8. PHP 8 version was released on <strong>26 November 2020<\/strong>.<\/p>\n\n\n\n<h3>1- JIT Derleyici<\/h3>\n\n\n\n<p>The most notable innovation with PHP 8 is the <strong>JIT (just in time) <\/strong>compiler. PHP 8 offers two JIT compilation engines.<strong> Tracing JIT <\/strong>and<strong> Function JIT.<\/strong> <strong><em>Tracing JIT<\/em> <\/strong>has a superior feature.<\/p>\n\n\n\n<p><strong>JIT<\/strong> was implemented as an almost independent part of <strong>OPcache<\/strong>. JIT working mechanism; the code is monitored and frequently used parts are compiled as bytcode and the compiled parts are executed at runtime.<\/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 performance metrics (kinsta.com)<\/figcaption><\/figure>\n\n\n\n<p>Since JIT is part of <strong>OPcache<\/strong>, OPcache must be enabled. For this, we need to set <code>opcache.enable=1<\/code> in <code>php.ini<\/code> file. Then we need to allocate memory like <code>opcache.jit_buffer_size=1024M<\/code> to enable JIT. Its default value is 0, so the JIT compiler is disabled. If you&#8217;re not sure if it&#8217;s enabled, you can check using the <code>opcache_get_status<\/code> function.<\/p>\n\n\n\n<h3>2- Union Types<\/h3>\n\n\n\n<p>With PHP 8, it allows <strong>multiple type<\/strong> definitions in variables, parameter declarations in functions, and function return type declarations.<\/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 Operator<\/h3>\n\n\n\n<p>With the null safe operator, we can more easily check with the null check <strong>?<\/strong> operator in chain methods. If a method returns <strong>null<\/strong>, the process is stopped.<\/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- Match Expression<\/h3>\n\n\n\n<p>PHP 8 comes with a shorter and simpler structure of the <strong>switch case<\/strong> statement, the <strong>match<\/strong> statement. The result of the operation can be assigned to a variable or the returned value can be used.<\/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\/\/OUTPUT: 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\/\/OUTPUT: This is what I expected<\/pre><\/div>\n\n\n\n<h3>5- <strong>Saner string to number comparisons<\/strong><\/h3>\n\n\n\n<p>At PHP 8, if a numeric value is compared to string, the numeric value is converted to string and compared. PHP8 avoids inconsistencies such as PHP7 considering <strong>0<\/strong> as an empty string or the comparison of <strong>123 == &#8220;123abc&#8221;<\/strong> returning <strong>true<\/strong> instead of <strong>false<\/strong>.<\/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- <strong>Named Arguments<\/strong><\/h3>\n\n\n\n<p>We can specify mandatory parameters of a method or function and skip optional ones. For example, in a function that takes 9 parameters, the first 2 parameters are mandatory and the others are optional. If we want to send a value to only the 9th one of the optional parameters, we send the value to be sent to the function with its name.<\/p>\n\n\n\n<p>In addition, if we define the parameters to be sent with their names, we can send them in the order we want.<\/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- <strong>Constructor property promotion<\/strong><\/h3>\n\n\n\n<p>With PHP 8, it is easier to define and initialize properties inside the constructor method.<\/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>A feature called <strong>annotation in Java, decorator in JavaScript and python<\/strong> and used to define <strong>metadata<\/strong> to classes, methods, functions, and variables is now available in PHP8.<\/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- <strong>Consistent type errors for internal functions<\/strong><\/h3>\n\n\n\n<p>PHP built-in functions now give more consistent error messages.<\/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- Other Features<\/h3>\n\n\n\n<p><strong>str_contains()<\/strong> : Checks whether a string expression contains another string expression. Returns a <code>boolean<\/code> value.<\/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;) \/\/ Output : true <\/pre><\/div>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<p><strong>str_starts_with()<\/strong> :Checks whether a string expression starts with another string expression. Returns a <code>boolean <\/code>value.<\/p>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<p><strong>str_ends_with()<\/strong>: Checks if a string expression ends with another string expression. Returns a <code>boolean<\/code> value.<\/p>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<p><strong>get_debug_type()<\/strong>: <strong>get_debug_type ()<\/strong> does the same thing as <strong>gettype ()<\/strong> we used before and returns us the type of the variable.<\/p>\n\n\n\n<p>When the table below is examined, the differences between them will be understood more clearly.<\/p>\n\n\n\n<figure class=\"wp-block-table is-style-stripes\"><table><thead><tr><th>Type<\/th><th>Sample Value<\/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>Class<\/td><td><code>new Foo\\Bar()<\/code><\/td><td><code>object<\/code><\/td><td><code>Foo\\Bar<\/code><\/td><\/tr><tr><td>Class<\/td><td><code>new DateTime()<\/code><\/td><td><code>object<\/code><\/td><td><code>DateTime<\/code><\/td><\/tr><tr><td>Anonymous Class<\/td><td><code>new class {}<\/code><\/td><td><code>object<\/code><\/td><td><code>class@anonymous<\/code><\/td><\/tr><tr><td>Anonymous Class<\/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> : This function allows <strong>division by zero<\/strong><\/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>  In PHP8, type definition of <strong>mixed<\/strong> type can be made and it replaces the following types.<\/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>trailing commas in parameter lists: <\/strong>We can put a comma in the last parameter when defining a function.<\/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>using ::class on object :<\/strong> The use of <strong>get_class()<\/strong> before is now possible with $foo::class and gives the same result.<\/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>Good Luck &#8230;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Many new features have come to PHP over the years. With these new features, PHP has become a more powerful, modern, stable and faster language. In this post, I will explain the new features that come with PHP 8. PHP 8 version was released on 26 November 2020. 1- JIT Derleyici The most notable innovation [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[2],"tags":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v16.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>PHP 8 New Features - blog website<\/title>\n<meta name=\"description\" content=\"Many new features have come to PHP over the years. With these new features, PHP has become a more powerful, modern, stable and faster language. In this post, I will explain the new features that come with PHP 8. PHP 8 version was released on 26 November 2020.1- JIT DerleyiciThe most notable innovation with PHP 8 is the JIT (just in time) compiler. PHP 8 offers two JIT compilation engines. Tracing JIT and Function JIT. Tracing JIT has a superior feature.JIT was implemented as an almost independent part of OPcache. JIT working mechanism; the code is monitored and frequently used parts are compiled as bytcode and the compiled parts are executed at runtime.\" \/>\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\/2021\/05\/29\/php-8-new-features\/\" \/>\n<meta property=\"og:locale\" content=\"tr_TR\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"PHP 8 New Features - blog website\" \/>\n<meta property=\"og:description\" content=\"Many new features have come to PHP over the years. With these new features, PHP has become a more powerful, modern, stable and faster language. In this post, I will explain the new features that come with PHP 8. PHP 8 version was released on 26 November 2020.1- JIT DerleyiciThe most notable innovation with PHP 8 is the JIT (just in time) compiler. PHP 8 offers two JIT compilation engines. Tracing JIT and Function JIT. Tracing JIT has a superior feature.JIT was implemented as an almost independent part of OPcache. JIT working mechanism; the code is monitored and frequently used parts are compiled as bytcode and the compiled parts are executed at runtime.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.etemkeskin.com\/index.php\/2021\/05\/29\/php-8-new-features\/\" \/>\n<meta property=\"og:site_name\" content=\"blog website\" \/>\n<meta property=\"article:published_time\" content=\"2021-05-29T19:49:32+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-05-29T22:16:48+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=\"5 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\/2021\/05\/29\/php-8-new-features\/#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\/2021\/05\/29\/php-8-new-features\/#webpage\",\"url\":\"https:\/\/www.etemkeskin.com\/index.php\/2021\/05\/29\/php-8-new-features\/\",\"name\":\"PHP 8 New Features - blog website\",\"isPartOf\":{\"@id\":\"https:\/\/www.etemkeskin.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.etemkeskin.com\/index.php\/2021\/05\/29\/php-8-new-features\/#primaryimage\"},\"datePublished\":\"2021-05-29T19:49:32+00:00\",\"dateModified\":\"2021-05-29T22:16:48+00:00\",\"author\":{\"@id\":\"https:\/\/www.etemkeskin.com\/#\/schema\/person\/dcbc30282861ce578b96a79ce8789629\"},\"description\":\"Many new features have come to PHP over the years. With these new features, PHP has become a more powerful, modern, stable and faster language. In this post, I will explain the new features that come with PHP 8. PHP 8 version was released on 26 November 2020.1- JIT DerleyiciThe most notable innovation with PHP 8 is the JIT (just in time) compiler. PHP 8 offers two JIT compilation engines. Tracing JIT and Function JIT. Tracing JIT has a superior feature.JIT was implemented as an almost independent part of OPcache. JIT working mechanism; the code is monitored and frequently used parts are compiled as bytcode and the compiled parts are executed at runtime.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.etemkeskin.com\/index.php\/2021\/05\/29\/php-8-new-features\/#breadcrumb\"},\"inLanguage\":\"tr\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.etemkeskin.com\/index.php\/2021\/05\/29\/php-8-new-features\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.etemkeskin.com\/index.php\/2021\/05\/29\/php-8-new-features\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Ana sayfa\",\"item\":\"https:\/\/www.etemkeskin.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"PHP 8 New Features\"}]},{\"@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\/1533"}],"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=1533"}],"version-history":[{"count":110,"href":"https:\/\/www.etemkeskin.com\/index.php\/wp-json\/wp\/v2\/posts\/1533\/revisions"}],"predecessor-version":[{"id":1654,"href":"https:\/\/www.etemkeskin.com\/index.php\/wp-json\/wp\/v2\/posts\/1533\/revisions\/1654"}],"wp:attachment":[{"href":"https:\/\/www.etemkeskin.com\/index.php\/wp-json\/wp\/v2\/media?parent=1533"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.etemkeskin.com\/index.php\/wp-json\/wp\/v2\/categories?post=1533"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.etemkeskin.com\/index.php\/wp-json\/wp\/v2\/tags?post=1533"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}