3v4l.org

run code in 300+ PHP versions simultaneously
<?php $input = "30.10.2012"; $inputSplitChar = $reverse === false ? '.' : '-'; $OutputSplitChar = $reverse === false ? '-' : '.'; $resultArray = array_map('strrev', explode($inputSplitChar, strrev($input))); $result = implode($OutputSplitChar, $resultArray); echo $result;
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 5
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 6
Branch analysis from position: 6
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 11
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 11
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 5
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 11
Branch analysis from position: 9
Branch analysis from position: 11
filename:       /in/rh3Gu
function name:  (null)
number of ops:  32
compiled vars:  !0 = $input, !1 = $inputSplitChar, !2 = $reverse, !3 = $OutputSplitChar, !4 = $resultArray, !5 = $result
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '30.10.2012'
    4     1        TYPE_CHECK                                    4          !2
          2      > JMPZ                                                     ~7, ->5
          3    >   QM_ASSIGN                                        ~8      '.'
          4      > JMP                                                      ->6
          5    >   QM_ASSIGN                                        ~8      '-'
          6    >   ASSIGN                                                   !1, ~8
    5     7        TYPE_CHECK                                    4          !2
          8      > JMPZ                                                     ~10, ->11
          9    >   QM_ASSIGN                                        ~11     '-'
         10      > JMP                                                      ->12
         11    >   QM_ASSIGN                                        ~11     '.'
         12    >   ASSIGN                                                   !3, ~11
    7    13        INIT_FCALL                                               'array_map'
         14        SEND_VAL                                                 'strrev'
         15        INIT_FCALL                                               'explode'
         16        SEND_VAR                                                 !1
         17        INIT_FCALL                                               'strrev'
         18        SEND_VAR                                                 !0
         19        DO_ICALL                                         $13     
         20        SEND_VAR                                                 $13
         21        DO_ICALL                                         $14     
         22        SEND_VAR                                                 $14
         23        DO_ICALL                                         $15     
         24        ASSIGN                                                   !4, $15
    8    25        INIT_FCALL                                               'implode'
         26        SEND_VAR                                                 !3
         27        SEND_VAR                                                 !4
         28        DO_ICALL                                         $17     
         29        ASSIGN                                                   !5, $17
    9    30        ECHO                                                     !5
         31      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
171.77 ms | 1396 KiB | 21 Q