3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = 'asd/trara'; if (count(strpos($string, '/')) < 2) { $split = explode($string, '/'); } else { $split = array_map( function($value) { return implode('/', $value); }, array_chunk(explode('/', $string), 2) ); } return var_dump($split);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 14
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 28
Branch analysis from position: 28
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/KXJnI
function name:  (null)
number of ops:  33
compiled vars:  !0 = $string, !1 = $split
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'asd%2Ftrara'
    5     1        INIT_FCALL                                               'strpos'
          2        SEND_VAR                                                 !0
          3        SEND_VAL                                                 '%2F'
          4        DO_ICALL                                         $3      
          5        COUNT                                            ~4      $3
          6        IS_SMALLER                                               ~4, 2
          7      > JMPZ                                                     ~5, ->14
    6     8    >   INIT_FCALL                                               'explode'
          9        SEND_VAR                                                 !0
         10        SEND_VAL                                                 '%2F'
         11        DO_ICALL                                         $6      
         12        ASSIGN                                                   !1, $6
         13      > JMP                                                      ->28
    8    14    >   INIT_FCALL                                               'array_map'
    9    15        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FKXJnI%3A9%240'
   11    16        SEND_VAL                                                 ~8
   12    17        INIT_FCALL                                               'array_chunk'
         18        INIT_FCALL                                               'explode'
         19        SEND_VAL                                                 '%2F'
         20        SEND_VAR                                                 !0
         21        DO_ICALL                                         $9      
         22        SEND_VAR                                                 $9
         23        SEND_VAL                                                 2
         24        DO_ICALL                                         $10     
         25        SEND_VAR                                                 $10
         26        DO_ICALL                                         $11     
    8    27        ASSIGN                                                   !1, $11
   16    28    >   INIT_FCALL                                               'var_dump'
         29        SEND_VAR                                                 !1
         30        DO_ICALL                                         $13     
         31      > RETURN                                                   $13
         32*     > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FKXJnI%3A9%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/KXJnI
function name:  {closure}
number of ops:  7
compiled vars:  !0 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   RECV                                             !0      
   10     1        INIT_FCALL                                               'implode'
          2        SEND_VAL                                                 '%2F'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $1      
          5      > RETURN                                                   $1
   11     6*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FKXJnI%3A9%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.59 ms | 1400 KiB | 25 Q