3v4l.org

run code in 300+ PHP versions simultaneously
<?php $about_group = array( 'group_label' => 'About', 'group_description' => 'Overview of export report', 'items' => array(), ); $groups = 'Not an array'; if ( is_array( $groups ) ) { $groups = array_merge( array( 'about' => $about_group ), $groups ); $groups_count = count( $groups ); } else { // _doing_it_wrong() here. echo "_doing_it_wrong \n"; $groups = null; $groups_count = 0; } // Test and output results. var_dump( $groups ); var_dump( $groups_count ); $groups_json = json_encode( $groups ); var_dump( $groups_json );
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 13
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 16
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/P3VAM
function name:  (null)
number of ops:  30
compiled vars:  !0 = $about_group, !1 = $groups, !2 = $groups_count, !3 = $groups_json
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    8     1        ASSIGN                                                   !1, 'Not+an+array'
   10     2        TYPE_CHECK                                  128          !1
          3      > JMPZ                                                     ~6, ->13
   11     4    >   INIT_FCALL                                               'array_merge'
          5        INIT_ARRAY                                       ~7      !0, 'about'
          6        SEND_VAL                                                 ~7
          7        SEND_VAR                                                 !1
          8        DO_ICALL                                         $8      
          9        ASSIGN                                                   !1, $8
   12    10        COUNT                                            ~10     !1
         11        ASSIGN                                                   !2, ~10
   10    12      > JMP                                                      ->16
   15    13    >   ECHO                                                     '_doing_it_wrong+%0A'
   16    14        ASSIGN                                                   !1, null
   17    15        ASSIGN                                                   !2, 0
   21    16    >   INIT_FCALL                                               'var_dump'
         17        SEND_VAR                                                 !1
         18        DO_ICALL                                                 
   23    19        INIT_FCALL                                               'var_dump'
         20        SEND_VAR                                                 !2
         21        DO_ICALL                                                 
   25    22        INIT_FCALL                                               'json_encode'
         23        SEND_VAR                                                 !1
         24        DO_ICALL                                         $16     
         25        ASSIGN                                                   !3, $16
   26    26        INIT_FCALL                                               'var_dump'
         27        SEND_VAR                                                 !3
         28        DO_ICALL                                                 
         29      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.94 ms | 1019 KiB | 16 Q