3v4l.org

run code in 300+ PHP versions simultaneously
<?php function display_post( $postdata ) { echo "<div class='post'>"; echo "<h1>" . $postdata['post_title'] . "</h1>"; echo "<p>" . $postdata['post_excerpt'] . "</p>"; echo "<div class='post-meta'>Published on " . $postdata['post_date'] . " by " . $postdata['post_author'] . "</div>"; echo "</div>"; } $posts = array( 0 => array( "post_title" => "My First Post", "post_excerpt" => "This is a short snippet of text from the first post", "post_date" => "2015 December 1", "post_author" => "Daniel Pataki" ), 1 => array( "post_title" => "Second Post", "post_excerpt" => "Short exceprt for post number 2", "post_date" => "2015 December 4", "post_author" => "Raelene Morey" ) ); foreach( $posts as $post ) { display_post( $post ); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 2, Position 2 = 7
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 7
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
filename:       /in/jUrcg
function name:  (null)
number of ops:  9
compiled vars:  !0 = $posts, !1 = $post
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   ASSIGN                                                   !0, <array>
   23     1      > FE_RESET_R                                       $3      !0, ->7
          2    > > FE_FETCH_R                                               $3, !1, ->7
   24     3    >   INIT_FCALL                                               'display_post'
          4        SEND_VAR                                                 !1
          5        DO_FCALL                                      0          
   23     6      > JMP                                                      ->2
          7    >   FE_FREE                                                  $3
   25     8      > RETURN                                                   1

Function display_post:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/jUrcg
function name:  display_post
number of ops:  19
compiled vars:  !0 = $postdata
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
    3     1        ECHO                                                     '%3Cdiv+class%3D%27post%27%3E'
    4     2        FETCH_DIM_R                                      ~1      !0, 'post_title'
          3        CONCAT                                           ~2      '%3Ch1%3E', ~1
          4        CONCAT                                           ~3      ~2, '%3C%2Fh1%3E'
          5        ECHO                                                     ~3
    5     6        FETCH_DIM_R                                      ~4      !0, 'post_excerpt'
          7        CONCAT                                           ~5      '%3Cp%3E', ~4
          8        CONCAT                                           ~6      ~5, '%3C%2Fp%3E'
          9        ECHO                                                     ~6
    6    10        FETCH_DIM_R                                      ~7      !0, 'post_date'
         11        CONCAT                                           ~8      '%3Cdiv+class%3D%27post-meta%27%3EPublished+on+', ~7
         12        CONCAT                                           ~9      ~8, '+by+'
         13        FETCH_DIM_R                                      ~10     !0, 'post_author'
         14        CONCAT                                           ~11     ~9, ~10
         15        CONCAT                                           ~12     ~11, '%3C%2Fdiv%3E'
         16        ECHO                                                     ~12
    7    17        ECHO                                                     '%3C%2Fdiv%3E'
    8    18      > RETURN                                                   null

End of function display_post

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
164.27 ms | 1399 KiB | 14 Q