3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = " line 1 line 2 line 3\r line 4 "; $str_cleared = join("\n", array_map('trim', explode("\n", $str))); var_dump($str); var_dump($str_cleared);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/PnqZ9
function name:  (null)
number of ops:  21
compiled vars:  !0 = $str, !1 = $str_cleared
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '%0A++++line+1%0A++++line+2%0A++++line+3%0D%0A++++line+4%0A++++'
   10     1        INIT_FCALL                                               'join'
          2        SEND_VAL                                                 '%0A'
          3        INIT_FCALL                                               'array_map'
          4        SEND_VAL                                                 'trim'
          5        INIT_FCALL                                               'explode'
          6        SEND_VAL                                                 '%0A'
          7        SEND_VAR                                                 !0
          8        DO_ICALL                                         $3      
          9        SEND_VAR                                                 $3
         10        DO_ICALL                                         $4      
         11        SEND_VAR                                                 $4
         12        DO_ICALL                                         $5      
         13        ASSIGN                                                   !1, $5
   12    14        INIT_FCALL                                               'var_dump'
         15        SEND_VAR                                                 !0
         16        DO_ICALL                                                 
   13    17        INIT_FCALL                                               'var_dump'
         18        SEND_VAR                                                 !1
         19        DO_ICALL                                                 
         20      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
137.04 ms | 1000 KiB | 17 Q