3v4l.org

run code in 300+ PHP versions simultaneously
<?php $foo = 's a c dd a'; $bar = str_replace(' ', '', $foo); $arr = array(); for($i = 0; $i <= strlen($bar); $i++) { array_push($arr, $bar[$i]); } var_dump($arr);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 16
Branch analysis from position: 16
2 jumps found. (Code = 44) Position 1 = 19, Position 2 = 10
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
2 jumps found. (Code = 44) Position 1 = 19, Position 2 = 10
Branch analysis from position: 19
Branch analysis from position: 10
filename:       /in/A6jDb
function name:  (null)
number of ops:  23
compiled vars:  !0 = $foo, !1 = $bar, !2 = $arr, !3 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 's++++a+c+dd+a'
    4     1        INIT_FCALL                                               'str_replace'
          2        SEND_VAL                                                 '+'
          3        SEND_VAL                                                 ''
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $5      
          6        ASSIGN                                                   !1, $5
    5     7        ASSIGN                                                   !2, <array>
    7     8        ASSIGN                                                   !3, 0
          9      > JMP                                                      ->16
    8    10    >   INIT_FCALL                                               'array_push'
         11        SEND_REF                                                 !2
         12        FETCH_DIM_R                                      ~9      !1, !3
         13        SEND_VAL                                                 ~9
         14        DO_ICALL                                                 
    7    15        PRE_INC                                                  !3
         16    >   STRLEN                                           ~12     !1
         17        IS_SMALLER_OR_EQUAL                                      !3, ~12
         18      > JMPNZ                                                    ~13, ->10
   11    19    >   INIT_FCALL                                               'var_dump'
         20        SEND_VAR                                                 !2
         21        DO_ICALL                                                 
         22      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
158.6 ms | 1395 KiB | 19 Q