3v4l.org

run code in 300+ PHP versions simultaneously
<?php $dbDownloads = array( 0 => array( "name" => "Xvid_Download.txt", "userId" => 1, "torrentId" => "4e1210f2469a7078eb0ecd6ef462d16f44d99837", "id" => 1 ), 1 => array( "name" => "Lol.mp4", "userId" => 2, "torrentId" => "e3811b9539cacff680e418124272177c47477157", "id" => 2 ), 2 => array( "name" => "Ubuntu-13.04.iso", "userId" => 1, "torrentId" => "c877dcecd3b14d02c0eccfd4e67a2cee71518405", "id" => 3 ), 3 => array( "name" => "NonDownload.lol", "userId" => 2, "torrentId" => "b7687dbbh8873dcc87464gf4387g78g7gf828887", "id" => 4 ) ); $clientTorrents = array( 0 => array( "hashString" => "4e1210f2469a7078eb0ecd6ef462d16f44d99837", "name" => "Xvid_Download.txt" ), 1 => array( "hashString" => "c877dcecd3b14d02c0eccfd4e67a2cee71518405", "name" => "Ubuntu-13.04.iso" ), 2 => array( "hashString" => "b7687dbbh8873dcc87464gf4387g78g7gf828887", "torrentname" => "NonDownload.lol" ), 3 => array( "hashString" => "e3811b9539cacff680e418124272177c47477157", "torrentname" => "Lol.mp4" ) ); $merged = array(); foreach ($clientTorrents as $clientTorrent) { /** Match $dbDownload::torrentId against clientTorrent::$hashString **/ $dbDownload = array_values(array_filter($dbDownloads, function($dbDownload) use($clientTorrent) { return $dbDownload['torrentId'] === $clientTorrent['hashString']; }))[0]; var_dump($clientTorrent); var_dump("<br /><br />"); var_dump($dbDownload); var_dump("<br /><br />---------------<br />"); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 4, Position 2 = 29
Branch analysis from position: 4
2 jumps found. (Code = 78) Position 1 = 5, Position 2 = 29
Branch analysis from position: 5
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 29
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 29
filename:       /in/aMBQ3
function name:  (null)
number of ops:  31
compiled vars:  !0 = $dbDownloads, !1 = $clientTorrents, !2 = $merged, !3 = $clientTorrent, !4 = $dbDownload
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
   29     1        ASSIGN                                                   !1, <array>
   49     2        ASSIGN                                                   !2, <array>
   50     3      > FE_RESET_R                                       $8      !1, ->29
          4    > > FE_FETCH_R                                               $8, !3, ->29
   53     5    >   INIT_FCALL                                               'array_values'
          6        INIT_FCALL                                               'array_filter'
          7        SEND_VAR                                                 !0
          8        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FaMBQ3%3A53%240'
          9        BIND_LEXICAL                                             ~9, !3
   56    10        SEND_VAL                                                 ~9
         11        DO_ICALL                                         $10     
         12        SEND_VAR                                                 $10
         13        DO_ICALL                                         $11     
         14        FETCH_DIM_R                                      ~12     $11, 0
   53    15        ASSIGN                                                   !4, ~12
   59    16        INIT_FCALL                                               'var_dump'
         17        SEND_VAR                                                 !3
         18        DO_ICALL                                                 
   60    19        INIT_FCALL                                               'var_dump'
         20        SEND_VAL                                                 '%3Cbr+%2F%3E%3Cbr+%2F%3E'
         21        DO_ICALL                                                 
   61    22        INIT_FCALL                                               'var_dump'
         23        SEND_VAR                                                 !4
         24        DO_ICALL                                                 
   62    25        INIT_FCALL                                               'var_dump'
         26        SEND_VAL                                                 '%3Cbr+%2F%3E%3Cbr+%2F%3E---------------%3Cbr+%2F%3E'
         27        DO_ICALL                                                 
   50    28      > JMP                                                      ->4
         29    >   FE_FREE                                                  $8
   63    30      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FaMBQ3%3A53%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/aMBQ3
function name:  {closure}
number of ops:  7
compiled vars:  !0 = $dbDownload, !1 = $clientTorrent
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   53     0  E >   RECV                                             !0      
          1        BIND_STATIC                                              !1
   55     2        FETCH_DIM_R                                      ~2      !0, 'torrentId'
          3        FETCH_DIM_R                                      ~3      !1, 'hashString'
          4        IS_IDENTICAL                                     ~4      ~2, ~3
          5      > RETURN                                                   ~4
   56     6*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FaMBQ3%3A53%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
176.97 ms | 1404 KiB | 19 Q