3v4l.org

run code in 300+ PHP versions simultaneously
<?php $anna_array = array("soccer" => "10", "basketball" => "20", "atletics" => "40"); $john_array = array("soccer" => "15", "basketball" => "15", "atletics" => "45"); $common_sports = array_keys(array_intersect_key($anna_array, $john_array)); $points_anna_array = $points_john_array = array_fill_keys($common_sports, 0); foreach ($common_sports as $common_sport) { if ($anna_array[$common_sport] > $john_array[$common_sport]) { $points_anna_array[$common_sport]++; } else if ($anna_array[$common_sport] < $john_array[$common_sport]) { $points_john_array[$common_sport]++; } } foreach ($common_sports as $common_sport) { echo sprintf( 'Anna(%s) %d vs John(%s) %d'."\n", $common_sport, $points_anna_array[$common_sport], $common_sport, $points_john_array[$common_sport] ); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 17, Position 2 = 32
Branch analysis from position: 17
2 jumps found. (Code = 78) Position 1 = 18, Position 2 = 32
Branch analysis from position: 18
2 jumps found. (Code = 43) Position 1 = 22, Position 2 = 25
Branch analysis from position: 22
1 jumps found. (Code = 42) Position 1 = 31
Branch analysis from position: 31
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
Branch analysis from position: 25
2 jumps found. (Code = 43) Position 1 = 29, Position 2 = 31
Branch analysis from position: 29
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
Branch analysis from position: 31
Branch analysis from position: 32
2 jumps found. (Code = 77) Position 1 = 34, Position 2 = 46
Branch analysis from position: 34
2 jumps found. (Code = 78) Position 1 = 35, Position 2 = 46
Branch analysis from position: 35
1 jumps found. (Code = 42) Position 1 = 34
Branch analysis from position: 34
Branch analysis from position: 46
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 46
Branch analysis from position: 32
filename:       /in/CU24b
function name:  (null)
number of ops:  48
compiled vars:  !0 = $anna_array, !1 = $john_array, !2 = $common_sports, !3 = $points_anna_array, !4 = $points_john_array, !5 = $common_sport
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    4     1        ASSIGN                                                   !1, <array>
    6     2        INIT_FCALL                                               'array_keys'
          3        INIT_FCALL                                               'array_intersect_key'
          4        SEND_VAR                                                 !0
          5        SEND_VAR                                                 !1
          6        DO_ICALL                                         $8      
          7        SEND_VAR                                                 $8
          8        DO_ICALL                                         $9      
          9        ASSIGN                                                   !2, $9
    8    10        INIT_FCALL                                               'array_fill_keys'
         11        SEND_VAR                                                 !2
         12        SEND_VAL                                                 0
         13        DO_ICALL                                         $11     
         14        ASSIGN                                           ~12     !4, $11
         15        ASSIGN                                                   !3, ~12
    9    16      > FE_RESET_R                                       $14     !2, ->32
         17    > > FE_FETCH_R                                               $14, !5, ->32
   10    18    >   FETCH_DIM_R                                      ~15     !0, !5
         19        FETCH_DIM_R                                      ~16     !1, !5
         20        IS_SMALLER                                               ~16, ~15
         21      > JMPZ                                                     ~17, ->25
   11    22    >   FETCH_DIM_RW                                     $18     !3, !5
         23        PRE_INC                                                  $18
   10    24      > JMP                                                      ->31
   12    25    >   FETCH_DIM_R                                      ~20     !0, !5
         26        FETCH_DIM_R                                      ~21     !1, !5
         27        IS_SMALLER                                               ~20, ~21
         28      > JMPZ                                                     ~22, ->31
   13    29    >   FETCH_DIM_RW                                     $23     !4, !5
         30        PRE_INC                                                  $23
    9    31    > > JMP                                                      ->17
         32    >   FE_FREE                                                  $14
   17    33      > FE_RESET_R                                       $25     !2, ->46
         34    > > FE_FETCH_R                                               $25, !5, ->46
   18    35    >   INIT_FCALL                                               'sprintf'
   19    36        SEND_VAL                                                 'Anna%28%25s%29+%25d+vs+John%28%25s%29+%25d%0A'
   20    37        SEND_VAR                                                 !5
         38        FETCH_DIM_R                                      ~26     !3, !5
         39        SEND_VAL                                                 ~26
   21    40        SEND_VAR                                                 !5
         41        FETCH_DIM_R                                      ~27     !4, !5
         42        SEND_VAL                                                 ~27
   18    43        DO_ICALL                                         $28     
   21    44        ECHO                                                     $28
   17    45      > JMP                                                      ->34
         46    >   FE_FREE                                                  $25
   23    47      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
141.54 ms | 1008 KiB | 17 Q