3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = [1, 2]; sort($arr); echo json_encode($arr); $arr = [2, 1]; sort($arr); echo json_encode($arr); $arr = ['foo' => 2, 'bar' => 1]; sort($arr); echo json_encode($arr); $arr = [2, 1]; // note: asort asort($arr); echo json_encode($arr);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/irsmV
function name:  (null)
number of ops:  33
compiled vars:  !0 = $arr
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    4     1        INIT_FCALL                                               'sort'
          2        SEND_REF                                                 !0
          3        DO_ICALL                                                 
    5     4        INIT_FCALL                                               'json_encode'
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                         $3      
          7        ECHO                                                     $3
    7     8        ASSIGN                                                   !0, <array>
    8     9        INIT_FCALL                                               'sort'
         10        SEND_REF                                                 !0
         11        DO_ICALL                                                 
    9    12        INIT_FCALL                                               'json_encode'
         13        SEND_VAR                                                 !0
         14        DO_ICALL                                         $6      
         15        ECHO                                                     $6
   12    16        ASSIGN                                                   !0, <array>
   13    17        INIT_FCALL                                               'sort'
         18        SEND_REF                                                 !0
         19        DO_ICALL                                                 
   14    20        INIT_FCALL                                               'json_encode'
         21        SEND_VAR                                                 !0
         22        DO_ICALL                                         $9      
         23        ECHO                                                     $9
   16    24        ASSIGN                                                   !0, <array>
   18    25        INIT_FCALL                                               'asort'
         26        SEND_REF                                                 !0
         27        DO_ICALL                                                 
   19    28        INIT_FCALL                                               'json_encode'
         29        SEND_VAR                                                 !0
         30        DO_ICALL                                         $12     
         31        ECHO                                                     $12
         32      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
147.56 ms | 1013 KiB | 16 Q