3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [0, 1, 0, 1, 0, 0]; var_export( array_map( 'intval', preg_split( '/(1)0|/', implode($array), 0, PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE ) ) );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/tVHXe
function name:  (null)
number of ops:  18
compiled vars:  !0 = $array
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    4     1        INIT_FCALL                                               'var_export'
    5     2        INIT_FCALL                                               'array_map'
    6     3        SEND_VAL                                                 'intval'
    7     4        INIT_FCALL                                               'preg_split'
    8     5        SEND_VAL                                                 '%2F%281%290%7C%2F'
    9     6        INIT_FCALL                                               'implode'
          7        SEND_VAR                                                 !0
          8        DO_ICALL                                         $2      
          9        SEND_VAR                                                 $2
   10    10        SEND_VAL                                                 0
   11    11        SEND_VAL                                                 3
    7    12        DO_ICALL                                         $3      
   11    13        SEND_VAR                                                 $3
    5    14        DO_ICALL                                         $4      
   11    15        SEND_VAR                                                 $4
    4    16        DO_ICALL                                                 
   14    17      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.46 ms | 1012 KiB | 17 Q