3v4l.org

run code in 300+ PHP versions simultaneously
<?php $dataArray = array( array( 20800, 21679, 0 ), array( 15254, 0, 3726 ), array( 17426, 2973, 0 ), array( 4391, 37, 0 ), array( 39194, 435, 0 ) ); $arr = [0,0,0]; foreach($dataArray as &$da){ $da = array_replace(array_fill(0,count($da),1), array_intersect($da, $arr)); } Var_dump($dataArray);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 125) Position 1 = 3, Position 2 = 20
Branch analysis from position: 3
2 jumps found. (Code = 126) Position 1 = 4, Position 2 = 20
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 20
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 20
filename:       /in/uaTcX
function name:  (null)
number of ops:  25
compiled vars:  !0 = $dataArray, !1 = $arr, !2 = $da
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   11     1        ASSIGN                                                   !1, <array>
   13     2      > FE_RESET_RW                                      $5      !0, ->20
          3    > > FE_FETCH_RW                                              $5, !2, ->20
   14     4    >   INIT_FCALL                                               'array_replace'
          5        INIT_FCALL                                               'array_fill'
          6        SEND_VAL                                                 0
          7        COUNT                                            ~6      !2
          8        SEND_VAL                                                 ~6
          9        SEND_VAL                                                 1
         10        DO_ICALL                                         $7      
         11        SEND_VAR                                                 $7
         12        INIT_FCALL                                               'array_intersect'
         13        SEND_VAR                                                 !2
         14        SEND_VAR                                                 !1
         15        DO_ICALL                                         $8      
         16        SEND_VAR                                                 $8
         17        DO_ICALL                                         $9      
         18        ASSIGN                                                   !2, $9
   13    19      > JMP                                                      ->3
         20    >   FE_FREE                                                  $5
   17    21        INIT_FCALL                                               'var_dump'
         22        SEND_VAR                                                 !0
         23        DO_ICALL                                                 
         24      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.49 ms | 1013 KiB | 17 Q