3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = 'one, two,need space, four '; // original $array = explode(',',$string); // simple but flawed $spaces_removed = array_map('trim', explode(',', $string)); var_dump($array); var_dump($spaces_removed);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/BWS1S
function name:  (null)
number of ops:  22
compiled vars:  !0 = $string, !1 = $array, !2 = $spaces_removed
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'one%2C+two%2Cneed+space%2C+four+'
    5     1        INIT_FCALL                                               'explode'
          2        SEND_VAL                                                 '%2C'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $4      
          5        ASSIGN                                                   !1, $4
    7     6        INIT_FCALL                                               'array_map'
          7        SEND_VAL                                                 'trim'
          8        INIT_FCALL                                               'explode'
          9        SEND_VAL                                                 '%2C'
         10        SEND_VAR                                                 !0
         11        DO_ICALL                                         $6      
         12        SEND_VAR                                                 $6
         13        DO_ICALL                                         $7      
         14        ASSIGN                                                   !2, $7
    9    15        INIT_FCALL                                               'var_dump'
         16        SEND_VAR                                                 !1
         17        DO_ICALL                                                 
   10    18        INIT_FCALL                                               'var_dump'
         19        SEND_VAR                                                 !2
         20        DO_ICALL                                                 
         21      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
144.13 ms | 1395 KiB | 19 Q