3v4l.org

run code in 300+ PHP versions simultaneously
<?php $tests = [ ", One ,, ,,", ", Two , Three", "Four, Five ", " Six,Seven, ", " ,Eight ,Nine , , , , Ten ,", ]; foreach ($tests as $test) { var_export( preg_replace('/[, ]+/', ', ', trim($test, ', ')) ); echo "\n"; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 2, Position 2 = 17
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 17
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 17
filename:       /in/iQXW1
function name:  (null)
number of ops:  19
compiled vars:  !0 = $tests, !1 = $test
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   11     1      > FE_RESET_R                                       $3      !0, ->17
          2    > > FE_FETCH_R                                               $3, !1, ->17
   12     3    >   INIT_FCALL                                               'var_export'
   13     4        INIT_FCALL                                               'preg_replace'
          5        SEND_VAL                                                 '%2F%5B%2C+%5D%2B%2F'
          6        SEND_VAL                                                 '%2C+'
          7        INIT_FCALL                                               'trim'
          8        SEND_VAR                                                 !1
          9        SEND_VAL                                                 '%2C+'
         10        DO_ICALL                                         $4      
         11        SEND_VAR                                                 $4
         12        DO_ICALL                                         $5      
         13        SEND_VAR                                                 $5
   12    14        DO_ICALL                                                 
   15    15        ECHO                                                     '%0A'
   11    16      > JMP                                                      ->2
         17    >   FE_FREE                                                  $3
   16    18      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
387.97 ms | 1001 KiB | 16 Q