3v4l.org

run code in 300+ PHP versions simultaneously
<?php $headers = array( 'one', 'two', 'three', ); $data = array( 'three' => 'someva3', 'one' => 'someval1', 'two' => 'someval2' ); print_r(array_flip($headers)); $correctOrder = array_merge(array_flip($headers), $data); print_r($correctOrder); $expected = array_values($correctOrder); print_r($expected);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/LHkYU
function name:  (null)
number of ops:  27
compiled vars:  !0 = $headers, !1 = $data, !2 = $correctOrder, !3 = $expected
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    9     1        ASSIGN                                                   !1, <array>
   15     2        INIT_FCALL                                               'print_r'
          3        INIT_FCALL                                               'array_flip'
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $6      
          6        SEND_VAR                                                 $6
          7        DO_ICALL                                                 
   17     8        INIT_FCALL                                               'array_merge'
          9        INIT_FCALL                                               'array_flip'
         10        SEND_VAR                                                 !0
         11        DO_ICALL                                         $8      
         12        SEND_VAR                                                 $8
         13        SEND_VAR                                                 !1
         14        DO_ICALL                                         $9      
         15        ASSIGN                                                   !2, $9
   19    16        INIT_FCALL                                               'print_r'
         17        SEND_VAR                                                 !2
         18        DO_ICALL                                                 
   21    19        INIT_FCALL                                               'array_values'
         20        SEND_VAR                                                 !2
         21        DO_ICALL                                         $12     
         22        ASSIGN                                                   !3, $12
   23    23        INIT_FCALL                                               'print_r'
         24        SEND_VAR                                                 !3
         25        DO_ICALL                                                 
         26      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
168.89 ms | 1395 KiB | 21 Q