3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [50, 50, 100, 175]; // no break $last = reset($array); $isSorted = true; foreach ($array as $value) { if ($last > $value) { $isSorted = false; break; } $last = $value; } var_export($isSorted); echo "\n---\n"; $array = [50, 150, 130, 175]; // break at third element: $array[2] $last = reset($array); $isSorted = true; foreach ($array as $value) { if ($last > $value) { $isSorted = false; break; } $last = $value; } var_export($isSorted);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 7, Position 2 = 14
Branch analysis from position: 7
2 jumps found. (Code = 78) Position 1 = 8, Position 2 = 14
Branch analysis from position: 8
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 12
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
2 jumps found. (Code = 77) Position 1 = 26, Position 2 = 33
Branch analysis from position: 26
2 jumps found. (Code = 78) Position 1 = 27, Position 2 = 33
Branch analysis from position: 27
2 jumps found. (Code = 43) Position 1 = 29, Position 2 = 31
Branch analysis from position: 29
1 jumps found. (Code = 42) Position 1 = 33
Branch analysis from position: 33
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 31
1 jumps found. (Code = 42) Position 1 = 26
Branch analysis from position: 26
Branch analysis from position: 33
Branch analysis from position: 33
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
Branch analysis from position: 14
Branch analysis from position: 14
filename:       /in/Rlgob
function name:  (null)
number of ops:  38
compiled vars:  !0 = $array, !1 = $last, !2 = $isSorted, !3 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    5     1        INIT_FCALL                                               'reset'
          2        SEND_REF                                                 !0
          3        DO_ICALL                                         $5      
          4        ASSIGN                                                   !1, $5
    6     5        ASSIGN                                                   !2, <true>
    7     6      > FE_RESET_R                                       $8      !0, ->14
          7    > > FE_FETCH_R                                               $8, !3, ->14
    8     8    >   IS_SMALLER                                               !3, !1
          9      > JMPZ                                                     ~9, ->12
    9    10    >   ASSIGN                                                   !2, <false>
   10    11      > JMP                                                      ->14
   12    12    >   ASSIGN                                                   !1, !3
    7    13      > JMP                                                      ->7
         14    >   FE_FREE                                                  $8
   14    15        INIT_FCALL                                               'var_export'
         16        SEND_VAR                                                 !2
         17        DO_ICALL                                                 
   16    18        ECHO                                                     '%0A---%0A'
   18    19        ASSIGN                                                   !0, <array>
   20    20        INIT_FCALL                                               'reset'
         21        SEND_REF                                                 !0
         22        DO_ICALL                                         $14     
         23        ASSIGN                                                   !1, $14
   21    24        ASSIGN                                                   !2, <true>
   22    25      > FE_RESET_R                                       $17     !0, ->33
         26    > > FE_FETCH_R                                               $17, !3, ->33
   23    27    >   IS_SMALLER                                               !3, !1
         28      > JMPZ                                                     ~18, ->31
   24    29    >   ASSIGN                                                   !2, <false>
   25    30      > JMP                                                      ->33
   27    31    >   ASSIGN                                                   !1, !3
   22    32      > JMP                                                      ->26
         33    >   FE_FREE                                                  $17
   29    34        INIT_FCALL                                               'var_export'
         35        SEND_VAR                                                 !2
         36        DO_ICALL                                                 
         37      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
141.58 ms | 1004 KiB | 15 Q