3v4l.org

run code in 300+ PHP versions simultaneously
<?php $out = ""; $arr = array(); $test = array('checkbox_1' => true); foreach( $test as $name => $element) { if(strstr($name, 'checkbox') !== false) $arr[] = str_replace('_', '', strstr($name, 'checkbox')); } $out = implode(',', $arr); echo $out;
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 4, Position 2 = 24
Branch analysis from position: 4
2 jumps found. (Code = 78) Position 1 = 5, Position 2 = 24
Branch analysis from position: 5
2 jumps found. (Code = 43) Position 1 = 12, Position 2 = 23
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 23
Branch analysis from position: 24
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 24
filename:       /in/cQZ7A
function name:  (null)
number of ops:  32
compiled vars:  !0 = $out, !1 = $arr, !2 = $test, !3 = $element, !4 = $name
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, ''
    4     1        ASSIGN                                                   !1, <array>
    5     2        ASSIGN                                                   !2, <array>
    6     3      > FE_RESET_R                                       $8      !2, ->24
          4    > > FE_FETCH_R                                       ~9      $8, !3, ->24
          5    >   ASSIGN                                                   !4, ~9
    7     6        INIT_FCALL                                               'strstr'
          7        SEND_VAR                                                 !4
          8        SEND_VAL                                                 'checkbox'
          9        DO_ICALL                                         $11     
         10        TYPE_CHECK                                  1018          $11
         11      > JMPZ                                                     ~12, ->23
    8    12    >   INIT_FCALL                                               'str_replace'
         13        SEND_VAL                                                 '_'
         14        SEND_VAL                                                 ''
         15        INIT_FCALL                                               'strstr'
         16        SEND_VAR                                                 !4
         17        SEND_VAL                                                 'checkbox'
         18        DO_ICALL                                         $14     
         19        SEND_VAR                                                 $14
         20        DO_ICALL                                         $15     
         21        ASSIGN_DIM                                               !1
         22        OP_DATA                                                  $15
    6    23    > > JMP                                                      ->4
         24    >   FE_FREE                                                  $8
   10    25        INIT_FCALL                                               'implode'
         26        SEND_VAL                                                 '%2C'
         27        SEND_VAR                                                 !1
         28        DO_ICALL                                         $16     
         29        ASSIGN                                                   !0, $16
   11    30        ECHO                                                     !0
         31      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.68 ms | 1396 KiB | 19 Q