3v4l.org

run code in 300+ PHP versions simultaneously
<?php $datas = [ [ 'article_id' => 1, 'article_title' => ' Article 1', 'article_content' => 'This is some dummy text for the first article.', ], [ 'article_id' => 2, 'article_title' => 'Article 2', 'article_content' => 'This is the content for article #2', ] ]; $linkID = 2; $articles = array_column($datas, null, 'article_id'); if (isset($articles[$linkID])) { list('article_title'=> $title, 'article_content' => $content) = $articles[$linkID]; echo $title . \PHP_EOL; echo $content . \PHP_EOL; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 20
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 20
filename:       /in/C2c4K
function name:  (null)
number of ops:  21
compiled vars:  !0 = $datas, !1 = $linkID, !2 = $articles, !3 = $title, !4 = $content
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   16     1        ASSIGN                                                   !1, 2
   18     2        INIT_FCALL                                               'array_column'
          3        SEND_VAR                                                 !0
          4        SEND_VAL                                                 null
          5        SEND_VAL                                                 'article_id'
          6        DO_ICALL                                         $7      
          7        ASSIGN                                                   !2, $7
   19     8        ISSET_ISEMPTY_DIM_OBJ                         0          !2, !1
          9      > JMPZ                                                     ~9, ->20
   20    10    >   FETCH_DIM_R                                      ~10     !2, !1
         11        FETCH_LIST_R                                     $11     ~10, 'article_title'
         12        ASSIGN                                                   !3, $11
         13        FETCH_LIST_R                                     $13     ~10, 'article_content'
         14        ASSIGN                                                   !4, $13
         15        FREE                                                     ~10
   22    16        CONCAT                                           ~15     !3, '%0A'
         17        ECHO                                                     ~15
   23    18        CONCAT                                           ~16     !4, '%0A'
         19        ECHO                                                     ~16
   24    20    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
141.9 ms | 1004 KiB | 14 Q