3v4l.org

run code in 300+ PHP versions simultaneously
<?php defined('SORT_FLAG_CASE') or define('SORT_FLAG_CASE', false); echo 'SORT_FLAG_CASE : '.SORT_FLAG_CASE."\n"; $arr = array('foo' => 2,'Bar' => 1, 'bar' => 3, 'a' => 0); if(SORT_FLAG_CASE) ksort($arr, SORT_STRING|SORT_FLAG_CASE); else{ $newArrs=array(); $arrKeys=array_keys($arr); natcasesort($arrKeys); foreach($arrKeys as $key){ $newArrs[$key]=$arr[$key]; } $arr=$newArrs; } var_dump($arr);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 8
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 24
Branch analysis from position: 24
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
2 jumps found. (Code = 77) Position 1 = 17, Position 2 = 22
Branch analysis from position: 17
2 jumps found. (Code = 78) Position 1 = 18, Position 2 = 22
Branch analysis from position: 18
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
Branch analysis from position: 22
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 22
filename:       /in/9rJKc
function name:  (null)
number of ops:  28
compiled vars:  !0 = $arr, !1 = $newArrs, !2 = $arrKeys, !3 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ECHO                                                     'SORT_FLAG_CASE+%3A+8%0A'
    4     1        ASSIGN                                                   !0, <array>
    5     2      > JMPZ                                                     8, ->8
    6     3    >   INIT_FCALL                                               'ksort'
          4        SEND_REF                                                 !0
          5        SEND_VAL                                                 10
          6        DO_ICALL                                                 
          7      > JMP                                                      ->24
    8     8    >   ASSIGN                                                   !1, <array>
    9     9        INIT_FCALL                                               'array_keys'
         10        SEND_VAR                                                 !0
         11        DO_ICALL                                         $7      
         12        ASSIGN                                                   !2, $7
   10    13        INIT_FCALL                                               'natcasesort'
         14        SEND_REF                                                 !2
         15        DO_ICALL                                                 
   11    16      > FE_RESET_R                                       $10     !2, ->22
         17    > > FE_FETCH_R                                               $10, !3, ->22
   12    18    >   FETCH_DIM_R                                      ~12     !0, !3
         19        ASSIGN_DIM                                               !1, !3
         20        OP_DATA                                                  ~12
   11    21      > JMP                                                      ->17
         22    >   FE_FREE                                                  $10
   14    23        ASSIGN                                                   !0, !1
   16    24    >   INIT_FCALL                                               'var_dump'
         25        SEND_VAR                                                 !0
         26        DO_ICALL                                                 
         27      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
177.66 ms | 1396 KiB | 21 Q