3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = 'asd/trara'; if (substr_count($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 = 7, Position 2 = 13
Branch analysis from position: 7
1 jumps found. (Code = 42) Position 1 = 27
Branch analysis from position: 27
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/aVMp1
function name:  (null)
number of ops:  32
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                                               'substr_count'
          2        SEND_VAR                                                 !0
          3        SEND_VAL                                                 '%2F'
          4        DO_ICALL                                         $3      
          5        IS_SMALLER                                               $3, 2
          6      > JMPZ                                                     ~4, ->13
    6     7    >   INIT_FCALL                                               'explode'
          8        SEND_VAR                                                 !0
          9        SEND_VAL                                                 '%2F'
         10        DO_ICALL                                         $5      
         11        ASSIGN                                                   !1, $5
         12      > JMP                                                      ->27
    8    13    >   INIT_FCALL                                               'array_map'
    9    14        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FaVMp1%3A9%240'
   11    15        SEND_VAL                                                 ~7
   12    16        INIT_FCALL                                               'array_chunk'
         17        INIT_FCALL                                               'explode'
         18        SEND_VAL                                                 '%2F'
         19        SEND_VAR                                                 !0
         20        DO_ICALL                                         $8      
         21        SEND_VAR                                                 $8
         22        SEND_VAL                                                 2
         23        DO_ICALL                                         $9      
         24        SEND_VAR                                                 $9
         25        DO_ICALL                                         $10     
    8    26        ASSIGN                                                   !1, $10
   16    27    >   INIT_FCALL                                               'var_dump'
         28        SEND_VAR                                                 !1
         29        DO_ICALL                                         $12     
         30      > RETURN                                                   $12
         31*     > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FaVMp1%3A9%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/aVMp1
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%2FaVMp1%3A9%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
169.96 ms | 1392 KiB | 25 Q