{"id":305360,"date":"2021-07-22T13:00:44","date_gmt":"2021-07-22T10:00:44","guid":{"rendered":"https:\/\/en.buradabiliyorum.com\/how-the-new-intersection-types-in-php-8-1-give-you-more-flexibility-cloudsavvy-it\/"},"modified":"2021-07-22T13:00:44","modified_gmt":"2021-07-22T10:00:44","slug":"how-the-new-intersection-types-in-php-8-1-give-you-more-flexibility-cloudsavvy-it","status":"publish","type":"post","link":"https:\/\/buradabiliyorum.com\/en\/how-the-new-intersection-types-in-php-8-1-give-you-more-flexibility-cloudsavvy-it\/","title":{"rendered":"#How the New Intersection Types in PHP 8.1 Give You More Flexibility \u2013 CloudSavvy IT"},"content":{"rendered":"<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_84 counter-hierarchy ez-toc-counter ez-toc-custom ez-toc-container-direction\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<label for=\"ez-toc-cssicon-toggle-item-6a2eeb84e4aca\" class=\"ez-toc-cssicon-toggle-label\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #dd3333;color:#dd3333\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #dd3333;color:#dd3333\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/label><input type=\"checkbox\"  id=\"ez-toc-cssicon-toggle-item-6a2eeb84e4aca\" checked aria-label=\"Toggle\" \/><nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/buradabiliyorum.com\/en\/how-the-new-intersection-types-in-php-8-1-give-you-more-flexibility-cloudsavvy-it\/#Basic_Syntax\" >Basic Syntax<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/buradabiliyorum.com\/en\/how-the-new-intersection-types-in-php-8-1-give-you-more-flexibility-cloudsavvy-it\/#Type_Variance\" >Type Variance<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/buradabiliyorum.com\/en\/how-the-new-intersection-types-in-php-8-1-give-you-more-flexibility-cloudsavvy-it\/#When_to_Use_Intersection_Types\" >When to Use Intersection Types?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/buradabiliyorum.com\/en\/how-the-new-intersection-types-in-php-8-1-give-you-more-flexibility-cloudsavvy-it\/#What_About_Composite_Types\" >What About Composite Types?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/buradabiliyorum.com\/en\/how-the-new-intersection-types-in-php-8-1-give-you-more-flexibility-cloudsavvy-it\/#Summary\" >Summary<\/a><\/li><\/ul><\/nav><\/div>\n<p><strong>&#8220;#How the New Intersection Types in PHP 8.1 Give You More Flexibility \u2013 CloudSavvy IT&#8221;<\/strong><\/p>\n<div id=\"article-content-area\">\n<img loading=\"lazy\" decoding=\"async\" class=\"type:primaryImage aligncenter size-full wp-image-4047\" srcset=\"https:\/\/www.cloudsavvyit.com\/p\/uploads\/2017\/08\/1ac500da.png?width=398&amp;trim=1,1&amp;bg-color=000&amp;pad=1,1 400w, https:\/\/www.cloudsavvyit.com\/p\/uploads\/2017\/08\/1ac500da.png?width=1198&amp;trim=1,1&amp;bg-color=000&amp;pad=1,1 1200w\" sizes=\"auto, 400w, 1200w\" src=\"https:\/\/www.cloudsavvyit.com\/p\/uploads\/2017\/08\/1ac500da.png?width=1198&amp;trim=1,1&amp;bg-color=000&amp;pad=1,1\" alt=\"PHP Logo\" width=\"1400\" height=\"600\" onload=\"pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\" onerror=\"this.onerror=null;pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\"\/><\/p>\n<p>Intersection types are a new type system feature coming in PHP 8.1. They let you typehint values that must satisfy more than one type constraint. PHP\u2019s already got union types that combine types with a logical \u201cor\u201d clause; intersection types offer an \u201cand\u201d clause instead.<\/p>\n<p>Some developers already typehint intersections using PHPDoc annotations. The addition of native support is a step forward as the types will actually be enforced at runtime. They\u2019re also fully compatible with class inheritance, helping reduce the risk of errors due to outdated or incompatible annotations.<\/p>\n<h2 id=\"basic-syntax\"><span class=\"ez-toc-section\" id=\"Basic_Syntax\"><\/span>Basic Syntax<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>The intersection type syntax is similar to union types:<\/p>\n<div class=\"wp-geshi-highlight-wrap5\">\n<div class=\"wp-geshi-highlight-wrap4\">\n<div class=\"wp-geshi-highlight-wrap3\">\n<div class=\"wp-geshi-highlight-wrap2\">\n<div class=\"wp-geshi-highlight-wrap\">\n<div class=\"wp-geshi-highlight\">\n<div class=\"php\">\n<pre class=\"de1\"><span class=\"kw2\">class<\/span> DemoClass <span class=\"br0\">{<\/span>\n\u00a0\n    <span class=\"kw2\">public<\/span> Countable<span class=\"sy0\">|<\/span>Stringable <span class=\"re0\">$Union<\/span><span class=\"sy0\">;<\/span>\n\u00a0\n    <span class=\"kw2\">public<\/span> Countable<span class=\"sy0\">&amp;<\/span>Stringable <span class=\"re0\">$Intersection<\/span><span class=\"sy0\">;<\/span>\n\u00a0\n<span class=\"br0\">}<\/span><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<p>In this example, <code>$Union<\/code> will be satisfied by any value which is <em>either<\/em> <code>Countable<\/code> or <code>Stringable<\/code>. <code>$Intersection<\/code> will only accept values that meet <em>both<\/em> the constraints. You\u2019ll get a <code>TypeError<\/code> if you assign the property a value that implements one or zero of the hinted types.<\/p>\n<p>Intersection types are supported everywhere that typehints work. You can use them with property definitions, function parameters, and return values.<\/p>\n<p>Unlike union types, intersections can only typehint interfaces and classes. A scalar intersection like <code>int&amp;string<\/code> is meaningless as it could never be satisfied. The <code>mixed<\/code> type is banned too, because every value will satisfy its constraint.<\/p>\n<h2 id=\"type-variance\"><span class=\"ez-toc-section\" id=\"Type_Variance\"><\/span>Type Variance<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Intersection types respect PHP\u2019s existing variance rules. The return types of overridden methods must be covariant, while parameter types are contravariant. Class properties are always invariant, so children cannot change the type definition unless the new signature is both a sub-type and super-type of the inherited one.<\/p>\n<p>For return values, the variance rules mean you can add additional intersection types in overridden methods. Methods may also remove, but not add, types to intersections used as parameters. These rules enforce the Liskov substitution principle.<\/p>\n<div class=\"wp-geshi-highlight-wrap5\">\n<div class=\"wp-geshi-highlight-wrap4\">\n<div class=\"wp-geshi-highlight-wrap3\">\n<div class=\"wp-geshi-highlight-wrap2\">\n<div class=\"wp-geshi-highlight-wrap\">\n<div class=\"wp-geshi-highlight\">\n<div class=\"php\">\n<pre class=\"de1\"><span class=\"kw2\">interface<\/span> I1 <span class=\"br0\">{<\/span>\n    <span class=\"kw2\">public<\/span> <span class=\"kw2\">function<\/span> method1<span class=\"br0\">(<\/span>A<span class=\"sy0\">&amp;<\/span>B <span class=\"re0\">$demo<\/span><span class=\"br0\">)<\/span> <span class=\"sy0\">:<\/span> X<span class=\"sy0\">&amp;<\/span>Y<span class=\"sy0\">;<\/span>\n    <span class=\"kw2\">public<\/span> <span class=\"kw2\">function<\/span> method2<span class=\"br0\">(<\/span>A<span class=\"sy0\">&amp;<\/span>B <span class=\"re0\">$demo<\/span><span class=\"br0\">)<\/span> <span class=\"sy0\">:<\/span> X<span class=\"sy0\">&amp;<\/span>Y<span class=\"sy0\">;<\/span>\n<span class=\"br0\">}<\/span>\n\u00a0\n<span class=\"kw2\">interface<\/span> I2 <span class=\"kw2\">extends<\/span> I1 <span class=\"br0\">{<\/span>\n\u00a0\n    <span class=\"co1\">\/\/ ALLOWED<\/span>\n    <span class=\"kw2\">public<\/span> <span class=\"kw2\">function<\/span> method1<span class=\"br0\">(<\/span>A <span class=\"re0\">$demo<\/span><span class=\"br0\">)<\/span> <span class=\"sy0\">:<\/span> X<span class=\"sy0\">&amp;<\/span>Y<span class=\"sy0\">&amp;<\/span>Z<span class=\"sy0\">;<\/span>\n\u00a0\n    <span class=\"co1\">\/\/ NOT ALLOWED<\/span>\n    <span class=\"kw2\">public<\/span> <span class=\"kw2\">function<\/span> method2<span class=\"br0\">(<\/span>A<span class=\"sy0\">&amp;<\/span>B<span class=\"sy0\">&amp;<\/span>C <span class=\"re0\">$demo<\/span><span class=\"br0\">)<\/span> <span class=\"sy0\">:<\/span> X<span class=\"sy0\">;<\/span>\n\u00a0\n<span class=\"br0\">}<\/span><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<p>In the case of <code>method1<\/code>, the constraints haven\u2019t actually changed. You\u2019re stating the overridden method can actually work with any <code>A<\/code>, even if it\u2019s not also an <code>X<\/code>. It\u2019s less specific which results in acceptable parameter variance. The return declaration is <em>more<\/em> specific, stating the value will implement <code>X<\/code>, <code>Y<\/code> and <code>Z<\/code>; in this scenario, adding specificity does not break the contract, as the value will still be accepted by anything that typehints <code>I1<\/code>.<\/p>\n<p>The <code>method2<\/code> override is broken on both counts. By requiring the input parameter satisfy <code>A<\/code>, <code>B<\/code> and <code>C<\/code>, it\u2019s no longer a drop-in replacement for <code>I1<\/code>. Similarly, <code>method2<\/code> only guarantees the return value will be an instance of <code>X<\/code>. This breaks the contract as anything typehinting <code>I1<\/code> requires the value to satisfy the intersection of <code>X<\/code> and <code>Y<\/code>.<\/p>\n<p>Intersections invert the practical variance rules of union types. As unions are combined using \u201cor,\u201d children can add parameter types and remove return types. The Liskov substitution principle is satisfied as the widening and narrowing effect of the type constraints is reversed.<\/p>\n<p>As with union types, variance rules also <a href=\"https:\/\/buradabiliyorum.com\/en\/category\/download-scripts-themes-apps\/\" data-internallinksmanager029f6b8e52c=\"9\" title=\"Download Scripts &amp; Themes &amp; Apps\" target=\"_blank\" rel=\"noopener\">app<\/a>ly to the types that make up an intersection \u2013 that\u2019s the individual <code>X<\/code> and <code>Y<\/code> parts of <code>X&amp;Y<\/code>. You may narrow a type when returning it \u2013 stating you\u2019ll return a sub-class \u2013 or widen it as a parameter, accepting a super-class.<\/p>\n<p>Intersections also possess some special rules around aliasing and concrete implementations. If you typehint <code>X&amp;Y<\/code> but write an interface <code>Z extends X, Y<\/code>, it\u2019s logical that <code>Z<\/code> satisfies the constraint. Consequently, you can typehint <code>Z<\/code> instead of <code>X&amp;Y<\/code> wherever co-variance is allowed:<\/p>\n<div class=\"wp-geshi-highlight-wrap5\">\n<div class=\"wp-geshi-highlight-wrap4\">\n<div class=\"wp-geshi-highlight-wrap3\">\n<div class=\"wp-geshi-highlight-wrap2\">\n<div class=\"wp-geshi-highlight-wrap\">\n<div class=\"wp-geshi-highlight\">\n<div class=\"php\">\n<pre class=\"de1\"><span class=\"kw2\">interface<\/span> Test <span class=\"kw2\">extends<\/span> X<span class=\"sy0\">,<\/span> Y <span class=\"br0\">{<\/span><span class=\"br0\">}<\/span>\n\u00a0\n<span class=\"kw2\">interface<\/span> Demo1 <span class=\"br0\">{<\/span>\n    <span class=\"kw2\">public<\/span> <span class=\"kw2\">function<\/span> demo<span class=\"br0\">(<\/span><span class=\"br0\">)<\/span> <span class=\"sy0\">:<\/span> X<span class=\"sy0\">&amp;<\/span>Y<span class=\"sy0\">;<\/span>\n<span class=\"br0\">}<\/span>\n\u00a0\n<span class=\"kw2\">interface<\/span> Demo2 <span class=\"br0\">{<\/span>\n    <span class=\"kw2\">public<\/span> <span class=\"kw2\">function<\/span> demo<span class=\"br0\">(<\/span><span class=\"br0\">)<\/span> <span class=\"sy0\">:<\/span> Test<span class=\"sy0\">;<\/span>\n<span class=\"br0\">}<\/span><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<p>This lets you typehint a concrete class or interface if you depend on additional functionality. It\u2019s acceptable as long as all the constraints in the intersection are satisfied by the final typehint.<\/p>\n<h2 id=\"when-to-use-intersection-types\"><span class=\"ez-toc-section\" id=\"When_to_Use_Intersection_Types\"><\/span>When to Use Intersection Types?<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Intersection types are for the times when you want to be sure a value satisfies a compound interface without actually defining that interface. Previous PHP versions didn\u2019t provide any native support for this, so you needed to add a mess of extra boilerplate to your codebase:<\/p>\n<div class=\"wp-geshi-highlight-wrap5\">\n<div class=\"wp-geshi-highlight-wrap4\">\n<div class=\"wp-geshi-highlight-wrap3\">\n<div class=\"wp-geshi-highlight-wrap2\">\n<div class=\"wp-geshi-highlight-wrap\">\n<div class=\"wp-geshi-highlight\">\n<div class=\"php\">\n<pre class=\"de1\"><span class=\"kw2\">interface<\/span> CountableStringable <span class=\"kw2\">extends<\/span> Countable<span class=\"sy0\">,<\/span> Stringable <span class=\"br0\">{<\/span>\n    <span class=\"co1\">\/\/ ...<\/span>\n<span class=\"br0\">}<\/span>\n\u00a0\n<span class=\"kw2\">class<\/span> FakeArray <span class=\"kw2\">implements<\/span> CountableStringable <span class=\"br0\">{<\/span>\n\u00a0\n    <span class=\"kw2\">public<\/span> <span class=\"kw3\">array<\/span> <span class=\"re0\">$items<\/span> <span class=\"sy0\">=<\/span> <span class=\"br0\">[<\/span><span class=\"br0\">]<\/span><span class=\"sy0\">;<\/span>\n\u00a0\n    <span class=\"kw2\">public<\/span> <span class=\"kw2\">function<\/span> <span class=\"kw3\">count<\/span><span class=\"br0\">(<\/span><span class=\"br0\">)<\/span> <span class=\"sy0\">:<\/span> int <span class=\"br0\">{<\/span>\n        <span class=\"kw1\">return<\/span> <span class=\"kw3\">count<\/span><span class=\"br0\">(<\/span><span class=\"re0\">$this<\/span> <span class=\"sy0\">-&gt;<\/span> <span class=\"me1\">items<\/span><span class=\"br0\">)<\/span><span class=\"sy0\">;<\/span>\n    <span class=\"br0\">}<\/span>\n\u00a0\n    <span class=\"kw2\">public<\/span> <span class=\"kw2\">function<\/span> __toString<span class=\"br0\">(<\/span><span class=\"br0\">)<\/span> <span class=\"sy0\">:<\/span> string <span class=\"br0\">{<\/span>\n        <span class=\"kw1\">return<\/span> <span class=\"kw3\">implode<\/span><span class=\"br0\">(<\/span><span class=\"st0\">\", \"<\/span><span class=\"sy0\">,<\/span> <span class=\"re0\">$this<\/span> <span class=\"sy0\">-&gt;<\/span> <span class=\"me1\">items<\/span><span class=\"br0\">)<\/span><span class=\"sy0\">;<\/span>\n    <span class=\"br0\">}<\/span>\n\u00a0\n<span class=\"br0\">}<\/span>\n\u00a0\n<span class=\"kw2\">class<\/span> DemoClass <span class=\"br0\">{<\/span>\n\u00a0\n    <span class=\"kw2\">public<\/span> CountableStringable <span class=\"re0\">$Value<\/span><span class=\"sy0\">;<\/span>\n\u00a0\n<span class=\"br0\">}<\/span><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<p>This leads to an excess of stub-like shallow interfaces to achieve basic intersection behavior. Although PHP developers have survived without intersections to date, their presence helps solidify the type system\u2019s compound capabilities. Using native intersections creates cleaner and more intuitive code.<\/p>\n<h2 id=\"what-about-composite-types\"><span class=\"ez-toc-section\" id=\"What_About_Composite_Types\"><\/span>What About Composite Types?<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>It\u2019s not possible to combine intersection and union types in the same typehint. While it would be technically possible, it\u2019s been omitted from the current RFC as there are ambiguities around syntax, precedence, and variance.<\/p>\n<p>Composite types remain an idea for the future. If they were added, you could start to add complex typehints like this:<\/p>\n<div class=\"wp-geshi-highlight-wrap5\">\n<div class=\"wp-geshi-highlight-wrap4\">\n<div class=\"wp-geshi-highlight-wrap3\">\n<div class=\"wp-geshi-highlight-wrap2\">\n<div class=\"wp-geshi-highlight-wrap\">\n<div class=\"wp-geshi-highlight\">\n<div class=\"php\">\n<pre class=\"de1\"><span class=\"kw2\">class<\/span> DemoClass <span class=\"br0\">{<\/span>\n\u00a0\n    <span class=\"kw2\">public<\/span> Countable<span class=\"sy0\">&amp;<\/span>Stringable<span class=\"sy0\">|<\/span>CountableStringable <span class=\"re0\">$Intersection<\/span><span class=\"sy0\">;<\/span>\n\u00a0\n<span class=\"br0\">}<\/span><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<p>This example class combines the two implementations from the above. If it worked, it would let you adopt native intersection types while retaining backward compatibility with old classes using the \u201cfake\u201d approach.<\/p>\n<p>Fully-fledged composite types would round off the multiple type handling facilitated by unions and intersections. In the meantime, you\u2019ll need to keep writing your own composite interfaces in these scenarios.<\/p>\n<h2 id=\"summary\"><span class=\"ez-toc-section\" id=\"Summary\"><\/span>Summary<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Intersection types are coming to PHP 8.1 and will unlock more advanced possibilities within the type system. Extending the options around composite types reduces the amount of code you need to write when multiple interfaces are supported.<\/p>\n<p>Intersections are an optional feature that will not introduce any incompatibilities with existing code. The RFC was implemented in the third PHP 8.1 alpha build. The final release will arrive <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/wiki.php.net\/todo\/php81\">in late November<\/a> later this year.\n<\/div>\n<blockquote><p><strong><span style=\"color: #ff6600;\">If you liked the article, do not forget to share it with your friends. Follow us on\u00a0<span style=\"color: #ff0000;\"><a style=\"color: #ff0000;\" href=\"https:\/\/news.google.com\/publications\/CAAqBwgKMLG0nwswvr63Aw\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">Google News<\/a><\/span>\u00a0too, click on the star and choose us from your favorites.<\/span><\/strong><\/p><\/blockquote>\n<blockquote>\n<p style=\"text-align: center;\">For forums sites go to <span style=\"color: #ff9900;\"><a style=\"color: #ff9900;\" href=\"https:\/\/forum.buradabiliyorum.com\/\" target=\"_blank\" rel=\"noopener\">Forum.BuradaBiliyorum.Com<\/a><\/span><\/strong><\/p>\n<\/blockquote>\n<blockquote>\n<p style=\"text-align: center;\"><strong>If you want to read more like this article, you can visit our <span style=\"color: #ff9900;\"><a style=\"color: #ff9900;\" href=\"https:\/\/en.buradabiliyorum.com\/technology\/\" target=\"_blank\" rel=\"noopener\">Technology category.<\/a><\/span><\/strong><\/p>\n<\/blockquote>\n<p><span style=\"color: black;\"><a style=\"color: #ff9900;\" href=\"https:\/\/www.cloudsavvyit.com\/12907\/how-the-new-intersection-types-in-php-8-1-give-you-more-flexibility\/\" target=\"_blank\" rel=\"noopener\">Source<\/a><\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>&#8220;#How the New Intersection Types in PHP 8.1 Give You More Flexibility \u2013 CloudSavvy IT&#8221; Intersection types are a new type system feature coming in PHP 8.1. They let you typehint values that must satisfy more than one type constraint. PHP\u2019s already got union types that combine types with a logical \u201cor\u201d clause; intersection types&#8230;<\/p>\n","protected":false},"author":1,"featured_media":305361,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"fifu_image_url":"https:\/\/www.cloudsavvyit.com\/p\/uploads\/2017\/08\/1ac500da.png","fifu_image_alt":"","footnotes":""},"categories":[18],"tags":[],"class_list":["post-305360","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-technology"],"_links":{"self":[{"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/posts\/305360","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/comments?post=305360"}],"version-history":[{"count":0,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/posts\/305360\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/media\/305361"}],"wp:attachment":[{"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/media?parent=305360"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/categories?post=305360"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/tags?post=305360"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}