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]++; } } echo $points_speler1_array[soccer]; 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 = 37, Position 2 = 49
Branch analysis from position: 37
2 jumps found. (Code = 78) Position 1 = 38, Position 2 = 49
Branch analysis from position: 38
1 jumps found. (Code = 42) Position 1 = 37
Branch analysis from position: 37
Branch analysis from position: 49
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 49
Branch analysis from position: 32
filename:       /in/CrZed
function name:  (null)
number of ops:  51
compiled vars:  !0 = $anna_array, !1 = $john_array, !2 = $common_sports, !3 = $points_anna_array, !4 = $points_john_array, !5 = $common_sport, !6 = $points_speler1_array
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                                         $9      
          7        SEND_VAR                                                 $9
          8        DO_ICALL                                         $10     
          9        ASSIGN                                                   !2, $10
    8    10        INIT_FCALL                                               'array_fill_keys'
         11        SEND_VAR                                                 !2
         12        SEND_VAL                                                 0
         13        DO_ICALL                                         $12     
         14        ASSIGN                                           ~13     !4, $12
         15        ASSIGN                                                   !3, ~13
    9    16      > FE_RESET_R                                       $15     !2, ->32
         17    > > FE_FETCH_R                                               $15, !5, ->32
   10    18    >   FETCH_DIM_R                                      ~16     !0, !5
         19        FETCH_DIM_R                                      ~17     !1, !5
         20        IS_SMALLER                                               ~17, ~16
         21      > JMPZ                                                     ~18, ->25
   11    22    >   FETCH_DIM_RW                                     $19     !3, !5
         23        PRE_INC                                                  $19
         24      > JMP                                                      ->31
   12    25    >   FETCH_DIM_R                                      ~21     !0, !5
         26        FETCH_DIM_R                                      ~22     !1, !5
         27        IS_SMALLER                                               ~21, ~22
         28      > JMPZ                                                     ~23, ->31
   13    29    >   FETCH_DIM_RW                                     $24     !4, !5
         30        PRE_INC                                                  $24
    9    31    > > JMP                                                      ->17
         32    >   FE_FREE                                                  $15
   17    33        FETCH_CONSTANT                                   ~26     'soccer'
         34        FETCH_DIM_R                                      ~27     !6, ~26
         35        ECHO                                                     ~27
   19    36      > FE_RESET_R                                       $28     !2, ->49
         37    > > FE_FETCH_R                                               $28, !5, ->49
   20    38    >   INIT_FCALL                                               'sprintf'
   21    39        SEND_VAL                                                 'Anna%28%25s%29+%25d+vs+John%28%25s%29+%25d%0A'
   22    40        SEND_VAR                                                 !5
         41        FETCH_DIM_R                                      ~29     !3, !5
         42        SEND_VAL                                                 ~29
   23    43        SEND_VAR                                                 !5
         44        FETCH_DIM_R                                      ~30     !4, !5
         45        SEND_VAL                                                 ~30
         46        DO_ICALL                                         $31     
         47        ECHO                                                     $31
   19    48      > JMP                                                      ->37
         49    >   FE_FREE                                                  $28
   25    50      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
164.08 ms | 1400 KiB | 21 Q