3v4l.org

run code in 300+ PHP versions simultaneously
<?php function getComments(){ $comments = [ "id" => 1, "comment" => "this is test comment", "favorite_users" => [10, 15, 2, 5], ]; return $comments + ['favorite_users_count' => count($comments['favorite_users'])]; } var_dump(getComments());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Xmv2Y
function name:  (null)
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   INIT_FCALL                                               'var_dump'
          1        INIT_FCALL                                               'getcomments'
          2        DO_FCALL                                      0  $0      
          3        SEND_VAR                                                 $0
          4        DO_ICALL                                                 
          5      > RETURN                                                   1

Function getcomments:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Xmv2Y
function name:  getComments
number of ops:  7
compiled vars:  !0 = $comments
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   ASSIGN                                                   !0, <array>
   10     1        FETCH_DIM_R                                      ~2      !0, 'favorite_users'
          2        COUNT                                            ~3      ~2
          3        INIT_ARRAY                                       ~4      ~3, 'favorite_users_count'
          4        ADD                                              ~5      !0, ~4
          5      > RETURN                                                   ~5
   11     6*     > RETURN                                                   null

End of function getcomments

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
140.77 ms | 1068 KiB | 15 Q