3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = "\n1|John|Smith|company name\r\naddress\r\nwhat they did\r\n2|Amy|Doe|company name\r"; $new = join("|",explode("\r\n",$str)); var_dump($str); $newest = str_replace(array("\n","\r"), "", $str); var_dump($new);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/37vH1
function name:  (null)
number of ops:  23
compiled vars:  !0 = $str, !1 = $new, !2 = $newest
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '%0A1%7CJohn%7CSmith%7Ccompany+name%0D%0Aaddress%0D%0Awhat+they+did%0D%0A2%7CAmy%7CDoe%7Ccompany+name%0D'
    3     1        INIT_FCALL                                               'join'
          2        SEND_VAL                                                 '%7C'
          3        INIT_FCALL                                               'explode'
          4        SEND_VAL                                                 '%0D%0A'
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                         $4      
          7        SEND_VAR                                                 $4
          8        DO_ICALL                                         $5      
          9        ASSIGN                                                   !1, $5
    4    10        INIT_FCALL                                               'var_dump'
         11        SEND_VAR                                                 !0
         12        DO_ICALL                                                 
    5    13        INIT_FCALL                                               'str_replace'
         14        SEND_VAL                                                 <array>
         15        SEND_VAL                                                 ''
         16        SEND_VAR                                                 !0
         17        DO_ICALL                                         $8      
         18        ASSIGN                                                   !2, $8
    6    19        INIT_FCALL                                               'var_dump'
         20        SEND_VAR                                                 !1
         21        DO_ICALL                                                 
         22      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
146.72 ms | 1395 KiB | 21 Q