3v4l.org

run code in 300+ PHP versions simultaneously
<?php $input = "0-1-1-3-1-1-3-5-0"; $array = explode('-', $input); $result = array_replace(array_fill(0, count($array), 0), array_unique($array)); var_export($result);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/oCMfY
function name:  (null)
number of ops:  24
compiled vars:  !0 = $input, !1 = $array, !2 = $result
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '0-1-1-3-1-1-3-5-0'
    4     1        INIT_FCALL                                               'explode'
          2        SEND_VAL                                                 '-'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $4      
          5        ASSIGN                                                   !1, $4
    5     6        INIT_FCALL                                               'array_replace'
          7        INIT_FCALL                                               'array_fill'
          8        SEND_VAL                                                 0
          9        COUNT                                            ~6      !1
         10        SEND_VAL                                                 ~6
         11        SEND_VAL                                                 0
         12        DO_ICALL                                         $7      
         13        SEND_VAR                                                 $7
         14        INIT_FCALL                                               'array_unique'
         15        SEND_VAR                                                 !1
         16        DO_ICALL                                         $8      
         17        SEND_VAR                                                 $8
         18        DO_ICALL                                         $9      
         19        ASSIGN                                                   !2, $9
    6    20        INIT_FCALL                                               'var_export'
         21        SEND_VAR                                                 !2
         22        DO_ICALL                                                 
         23      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
166.83 ms | 1457 KiB | 18 Q