3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = ["id" => 1, "last_name" => "Zimmer", "count" => 1]; $replace = ["id" => "Id", "last_name" => "LastName"]; $result = []; //code $keys = array_keys($a); $value = array_values($a); $keys = array_values(array_replace(array_combine($keys, $keys), array_intersect_key($replace , $a))); $result = array_combine($keys, $value); if( $result === ["Id" => 1, "LastName" => "Zimmer", "count" => 1]) { var_dump('yippee'); } else { var_dump('Fail ('); var_dump($result); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 34, Position 2 = 38
Branch analysis from position: 34
1 jumps found. (Code = 42) Position 1 = 44
Branch analysis from position: 44
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 38
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/G0jHq
function name:  (null)
number of ops:  45
compiled vars:  !0 = $a, !1 = $replace, !2 = $result, !3 = $keys, !4 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    4     1        ASSIGN                                                   !1, <array>
    5     2        ASSIGN                                                   !2, <array>
    8     3        INIT_FCALL                                               'array_keys'
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $8      
          6        ASSIGN                                                   !3, $8
    9     7        INIT_FCALL                                               'array_values'
          8        SEND_VAR                                                 !0
          9        DO_ICALL                                         $10     
         10        ASSIGN                                                   !4, $10
   11    11        INIT_FCALL                                               'array_values'
         12        INIT_FCALL                                               'array_replace'
         13        INIT_FCALL                                               'array_combine'
         14        SEND_VAR                                                 !3
         15        SEND_VAR                                                 !3
         16        DO_ICALL                                         $12     
         17        SEND_VAR                                                 $12
         18        INIT_FCALL                                               'array_intersect_key'
         19        SEND_VAR                                                 !1
         20        SEND_VAR                                                 !0
         21        DO_ICALL                                         $13     
         22        SEND_VAR                                                 $13
         23        DO_ICALL                                         $14     
         24        SEND_VAR                                                 $14
         25        DO_ICALL                                         $15     
         26        ASSIGN                                                   !3, $15
   12    27        INIT_FCALL                                               'array_combine'
         28        SEND_VAR                                                 !3
         29        SEND_VAR                                                 !4
         30        DO_ICALL                                         $17     
         31        ASSIGN                                                   !2, $17
   14    32        IS_IDENTICAL                                             !2, <array>
         33      > JMPZ                                                     ~19, ->38
   16    34    >   INIT_FCALL                                               'var_dump'
         35        SEND_VAL                                                 'yippee'
         36        DO_ICALL                                                 
         37      > JMP                                                      ->44
   20    38    >   INIT_FCALL                                               'var_dump'
         39        SEND_VAL                                                 'Fail+%28'
         40        DO_ICALL                                                 
   21    41        INIT_FCALL                                               'var_dump'
         42        SEND_VAR                                                 !2
         43        DO_ICALL                                                 
   22    44    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
169.07 ms | 1400 KiB | 25 Q