3v4l.org

run code in 300+ PHP versions simultaneously
<?php $strs = explode("\n", '21 14" 14" 14 16"'); foreach ($strs as $str) { echo preg_replace('/(?<!"|^)$/', '"', $str) . "\n"; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 6, Position 2 = 15
Branch analysis from position: 6
2 jumps found. (Code = 78) Position 1 = 7, Position 2 = 15
Branch analysis from position: 7
1 jumps found. (Code = 42) Position 1 = 6
Branch analysis from position: 6
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
filename:       /in/9pGEe
function name:  (null)
number of ops:  17
compiled vars:  !0 = $strs, !1 = $str
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'explode'
          1        SEND_VAL                                                 '%0A'
          2        SEND_VAL                                                 '21%0A14%22%0A14%22%0A14%0A%0A16%22'
          3        DO_ICALL                                         $2      
          4        ASSIGN                                                   !0, $2
    9     5      > FE_RESET_R                                       $4      !0, ->15
          6    > > FE_FETCH_R                                               $4, !1, ->15
   10     7    >   INIT_FCALL                                               'preg_replace'
          8        SEND_VAL                                                 '%2F%28%3F%3C%21%22%7C%5E%29%24%2F'
          9        SEND_VAL                                                 '%22'
         10        SEND_VAR                                                 !1
         11        DO_ICALL                                         $5      
         12        CONCAT                                           ~6      $5, '%0A'
         13        ECHO                                                     ~6
    9    14      > JMP                                                      ->6
         15    >   FE_FREE                                                  $4
   11    16      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.56 ms | 1014 KiB | 15 Q