3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr=[ ["2015年5月", "---", "---"], ["2015年12月", "(2016年1月20日)", "---"], ["2016年6月", "(2016年7月16日)", "---"] ]; // Aパターン $arr2=[]; foreach ($arr as $key => $value) { $arr2[]=preg_replace("/---/","000", $value); print_r($arr2); } // Bパターン $arr2=[]; foreach ($arr as $key => $value) { $arr2[]=preg_replace("/---/","000", $value); } print_r($arr2);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 16
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 16
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 16
2 jumps found. (Code = 77) Position 1 = 19, Position 2 = 29
Branch analysis from position: 19
2 jumps found. (Code = 78) Position 1 = 20, Position 2 = 29
Branch analysis from position: 20
1 jumps found. (Code = 42) Position 1 = 19
Branch analysis from position: 19
Branch analysis from position: 29
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 29
Branch analysis from position: 16
filename:       /in/8btm9
function name:  (null)
number of ops:  34
compiled vars:  !0 = $arr, !1 = $arr2, !2 = $value, !3 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
   10     1        ASSIGN                                                   !1, <array>
   11     2      > FE_RESET_R                                       $6      !0, ->16
          3    > > FE_FETCH_R                                       ~7      $6, !2, ->16
          4    >   ASSIGN                                                   !3, ~7
   12     5        INIT_FCALL                                               'preg_replace'
          6        SEND_VAL                                                 '%2F---%2F'
          7        SEND_VAL                                                 '000'
          8        SEND_VAR                                                 !2
          9        DO_ICALL                                         $10     
         10        ASSIGN_DIM                                               !1
         11        OP_DATA                                                  $10
   13    12        INIT_FCALL                                               'print_r'
         13        SEND_VAR                                                 !1
         14        DO_ICALL                                                 
   11    15      > JMP                                                      ->3
         16    >   FE_FREE                                                  $6
   18    17        ASSIGN                                                   !1, <array>
   19    18      > FE_RESET_R                                       $13     !0, ->29
         19    > > FE_FETCH_R                                       ~14     $13, !2, ->29
         20    >   ASSIGN                                                   !3, ~14
   20    21        INIT_FCALL                                               'preg_replace'
         22        SEND_VAL                                                 '%2F---%2F'
         23        SEND_VAL                                                 '000'
         24        SEND_VAR                                                 !2
         25        DO_ICALL                                         $17     
         26        ASSIGN_DIM                                               !1
         27        OP_DATA                                                  $17
   19    28      > JMP                                                      ->19
         29    >   FE_FREE                                                  $13
   23    30        INIT_FCALL                                               'print_r'
         31        SEND_VAR                                                 !1
         32        DO_ICALL                                                 
         33      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
174.76 ms | 1396 KiB | 17 Q