3v4l.org

run code in 300+ PHP versions simultaneously
<?php $myarr = array("world cup"); foreach($myarr as &$v){ if(strpos($v,'o')!==false) $myarr[] = str_replace('o','O',$v); if(strpos($v,'O')!==false) $myarr[] = str_replace('O','o',$v); } var_export($myarr);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 125) Position 1 = 2, Position 2 = 30
Branch analysis from position: 2
2 jumps found. (Code = 126) Position 1 = 3, Position 2 = 30
Branch analysis from position: 3
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 16
Branch analysis from position: 9
2 jumps found. (Code = 43) Position 1 = 22, Position 2 = 29
Branch analysis from position: 22
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 29
Branch analysis from position: 16
Branch analysis from position: 30
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 30
filename:       /in/Tp9s2
function name:  (null)
number of ops:  35
compiled vars:  !0 = $myarr, !1 = $v
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    5     1      > FE_RESET_RW                                      $3      !0, ->30
          2    > > FE_FETCH_RW                                              $3, !1, ->30
    6     3    >   INIT_FCALL                                               'strpos'
          4        SEND_VAR                                                 !1
          5        SEND_VAL                                                 'o'
          6        DO_ICALL                                         $4      
          7        TYPE_CHECK                                  1018          $4
          8      > JMPZ                                                     ~5, ->16
    7     9    >   INIT_FCALL                                               'str_replace'
         10        SEND_VAL                                                 'o'
         11        SEND_VAL                                                 'O'
         12        SEND_VAR                                                 !1
         13        DO_ICALL                                         $7      
         14        ASSIGN_DIM                                               !0
         15        OP_DATA                                                  $7
    8    16    >   INIT_FCALL                                               'strpos'
         17        SEND_VAR                                                 !1
         18        SEND_VAL                                                 'O'
         19        DO_ICALL                                         $8      
         20        TYPE_CHECK                                  1018          $8
         21      > JMPZ                                                     ~9, ->29
    9    22    >   INIT_FCALL                                               'str_replace'
         23        SEND_VAL                                                 'O'
         24        SEND_VAL                                                 'o'
         25        SEND_VAR                                                 !1
         26        DO_ICALL                                         $11     
         27        ASSIGN_DIM                                               !0
         28        OP_DATA                                                  $11
    5    29    > > JMP                                                      ->2
         30    >   FE_FREE                                                  $3
   12    31        INIT_FCALL                                               'var_export'
         32        SEND_VAR                                                 !0
         33        DO_ICALL                                                 
         34      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
175.39 ms | 1388 KiB | 19 Q