3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = "this is a string with lots of spaces ."; while(strpos($str, " ") !== false) $str = str_replace(" ", " ", $str); echo $str;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
2 jumps found. (Code = 44) Position 1 = 14, Position 2 = 2
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 2
2 jumps found. (Code = 44) Position 1 = 14, Position 2 = 2
Branch analysis from position: 14
Branch analysis from position: 2
filename:       /in/vYCgB
function name:  (null)
number of ops:  16
compiled vars:  !0 = $str
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'this+is++++++a+string+++with+lots+of+spaces++++.'
    5     1      > JMP                                                      ->8
    6     2    >   INIT_FCALL                                               'str_replace'
          3        SEND_VAL                                                 '++'
          4        SEND_VAL                                                 '+'
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                         $2      
          7        ASSIGN                                                   !0, $2
    5     8    >   INIT_FCALL                                               'strpos'
          9        SEND_VAR                                                 !0
         10        SEND_VAL                                                 '++'
         11        DO_ICALL                                         $4      
         12        TYPE_CHECK                                  1018          $4
         13      > JMPNZ                                                    ~5, ->2
    8    14    >   ECHO                                                     !0
         15      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.79 ms | 1016 KiB | 15 Q