3v4l.org

run code in 300+ PHP versions simultaneously
<?php $strings = [ "1,2,3,4", "1,2,3", "1,2" ]; $minElements = 3; $defElements = array_fill(0, $minElements, null); foreach ($strings as $string) { [$a, $b, $c] = array_replace($defElements, explode(',', $string, $minElements)); var_export($a); echo ' _ '; var_export($b); echo ' _ '; var_export($c); echo "\n-----------------\n"; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 9, Position 2 = 39
Branch analysis from position: 9
2 jumps found. (Code = 78) Position 1 = 10, Position 2 = 39
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
Branch analysis from position: 39
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 39
filename:       /in/ZWhSL
function name:  (null)
number of ops:  41
compiled vars:  !0 = $strings, !1 = $minElements, !2 = $defElements, !3 = $string, !4 = $a, !5 = $b, !6 = $c
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    8     1        ASSIGN                                                   !1, 3
    9     2        INIT_FCALL                                               'array_fill'
          3        SEND_VAL                                                 0
          4        SEND_VAR                                                 !1
          5        SEND_VAL                                                 null
          6        DO_ICALL                                         $9      
          7        ASSIGN                                                   !2, $9
   11     8      > FE_RESET_R                                       $11     !0, ->39
          9    > > FE_FETCH_R                                               $11, !3, ->39
   12    10    >   INIT_FCALL                                               'array_replace'
         11        SEND_VAR                                                 !2
         12        INIT_FCALL                                               'explode'
         13        SEND_VAL                                                 '%2C'
         14        SEND_VAR                                                 !3
         15        SEND_VAR                                                 !1
         16        DO_ICALL                                         $12     
         17        SEND_VAR                                                 $12
         18        DO_ICALL                                         $13     
         19        FETCH_LIST_R                                     $14     $13, 0
         20        ASSIGN                                                   !4, $14
         21        FETCH_LIST_R                                     $16     $13, 1
         22        ASSIGN                                                   !5, $16
         23        FETCH_LIST_R                                     $18     $13, 2
         24        ASSIGN                                                   !6, $18
         25        FREE                                                     $13
   13    26        INIT_FCALL                                               'var_export'
         27        SEND_VAR                                                 !4
         28        DO_ICALL                                                 
   14    29        ECHO                                                     '+_+'
   15    30        INIT_FCALL                                               'var_export'
         31        SEND_VAR                                                 !5
         32        DO_ICALL                                                 
   16    33        ECHO                                                     '+_+'
   17    34        INIT_FCALL                                               'var_export'
         35        SEND_VAR                                                 !6
         36        DO_ICALL                                                 
   18    37        ECHO                                                     '%0A-----------------%0A'
   11    38      > JMP                                                      ->9
         39    >   FE_FREE                                                  $11
   19    40      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
145.76 ms | 1010 KiB | 17 Q