3v4l.org

run code in 300+ PHP versions simultaneously
<?php $s = "123, 123, 456, 456, 123, 123"; $arr = explode(",", $s); $str =""; Foreach(array_chunk($arr,2) as $sub){ $str .= trim(implode(",",$sub)) .",<br>\n"; } Echo $str;
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 12, Position 2 = 23
Branch analysis from position: 12
2 jumps found. (Code = 78) Position 1 = 13, Position 2 = 23
Branch analysis from position: 13
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
Branch analysis from position: 23
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 23
filename:       /in/LQSA9
function name:  (null)
number of ops:  26
compiled vars:  !0 = $s, !1 = $arr, !2 = $str, !3 = $sub
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '123%2C+123%2C+456%2C+456%2C+123%2C+123'
    5     1        INIT_FCALL                                               'explode'
          2        SEND_VAL                                                 '%2C'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $5      
          5        ASSIGN                                                   !1, $5
    6     6        ASSIGN                                                   !2, ''
    7     7        INIT_FCALL                                               'array_chunk'
          8        SEND_VAR                                                 !1
          9        SEND_VAL                                                 2
         10        DO_ICALL                                         $8      
         11      > FE_RESET_R                                       $9      $8, ->23
         12    > > FE_FETCH_R                                               $9, !3, ->23
    8    13    >   INIT_FCALL                                               'trim'
         14        INIT_FCALL                                               'implode'
         15        SEND_VAL                                                 '%2C'
         16        SEND_VAR                                                 !3
         17        DO_ICALL                                         $10     
         18        SEND_VAR                                                 $10
         19        DO_ICALL                                         $11     
         20        CONCAT                                           ~12     $11, '%2C%3Cbr%3E%0A'
         21        ASSIGN_OP                                     8          !2, ~12
    7    22      > JMP                                                      ->12
         23    >   FE_FREE                                                  $9
   10    24        ECHO                                                     !2
   11    25      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.91 ms | 1406 KiB | 21 Q