3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = "This is a string"; $words = explode(" ", $str); $spaces=array(); $others=array(); foreach($words as $word) { if($word==' ') { array_push($spaces,$word); } else { array_push($others,$word); } } var_export([ 'words' => $words, 'spaces' => $spaces, 'others' => $others ]);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 9, Position 2 = 22
Branch analysis from position: 9
2 jumps found. (Code = 78) Position 1 = 10, Position 2 = 22
Branch analysis from position: 10
2 jumps found. (Code = 43) Position 1 = 12, Position 2 = 17
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 21
Branch analysis from position: 21
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
Branch analysis from position: 17
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
Branch analysis from position: 22
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 22
filename:       /in/Tq66W
function name:  (null)
number of ops:  30
compiled vars:  !0 = $str, !1 = $words, !2 = $spaces, !3 = $others, !4 = $word
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'This+is+a++++string'
    4     1        INIT_FCALL                                               'explode'
          2        SEND_VAL                                                 '+'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $6      
          5        ASSIGN                                                   !1, $6
    5     6        ASSIGN                                                   !2, <array>
    6     7        ASSIGN                                                   !3, <array>
    7     8      > FE_RESET_R                                       $10     !1, ->22
          9    > > FE_FETCH_R                                               $10, !4, ->22
    9    10    >   IS_EQUAL                                                 !4, '+'
         11      > JMPZ                                                     ~11, ->17
   11    12    >   INIT_FCALL                                               'array_push'
         13        SEND_REF                                                 !2
         14        SEND_VAR                                                 !4
         15        DO_ICALL                                                 
    9    16      > JMP                                                      ->21
   15    17    >   INIT_FCALL                                               'array_push'
         18        SEND_REF                                                 !3
         19        SEND_VAR                                                 !4
         20        DO_ICALL                                                 
    7    21    > > JMP                                                      ->9
         22    >   FE_FREE                                                  $10
   19    23        INIT_FCALL                                               'var_export'
   20    24        INIT_ARRAY                                       ~14     !1, 'words'
   21    25        ADD_ARRAY_ELEMENT                                ~14     !2, 'spaces'
   22    26        ADD_ARRAY_ELEMENT                                ~14     !3, 'others'
         27        SEND_VAL                                                 ~14
   19    28        DO_ICALL                                                 
   23    29      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.12 ms | 1013 KiB | 16 Q