3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = explode("|", "ID1==Vasya==200==URL1|ID2==Petya==100==URL2|ID3==Sergey==300==URL3"); $min = PHP_INT_MAX; $res = 0; foreach($arr as $k){ $els = explode("=", $k); if ($els[4] < $min){ $res = $els[4].",".$els[0].",".$els[2].",".$els[6]; $min = $els[4]; } } echo $res;
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 8, Position 2 = 31
Branch analysis from position: 8
2 jumps found. (Code = 78) Position 1 = 9, Position 2 = 31
Branch analysis from position: 9
2 jumps found. (Code = 43) Position 1 = 17, Position 2 = 30
Branch analysis from position: 17
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
Branch analysis from position: 30
Branch analysis from position: 31
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 31
filename:       /in/hf6vd
function name:  (null)
number of ops:  34
compiled vars:  !0 = $arr, !1 = $min, !2 = $res, !3 = $k, !4 = $els
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'explode'
          1        SEND_VAL                                                 '%7C'
          2        SEND_VAL                                                 'ID1%3D%3DVasya%3D%3D200%3D%3DURL1%7CID2%3D%3DPetya%3D%3D100%3D%3DURL2%7CID3%3D%3DSergey%3D%3D300%3D%3DURL3'
          3        DO_ICALL                                         $5      
          4        ASSIGN                                                   !0, $5
    5     5        ASSIGN                                                   !1, 9223372036854775807
    6     6        ASSIGN                                                   !2, 0
    8     7      > FE_RESET_R                                       $9      !0, ->31
          8    > > FE_FETCH_R                                               $9, !3, ->31
    9     9    >   INIT_FCALL                                               'explode'
         10        SEND_VAL                                                 '%3D'
         11        SEND_VAR                                                 !3
         12        DO_ICALL                                         $10     
         13        ASSIGN                                                   !4, $10
   10    14        FETCH_DIM_R                                      ~12     !4, 4
         15        IS_SMALLER                                               ~12, !1
         16      > JMPZ                                                     ~13, ->30
   11    17    >   FETCH_DIM_R                                      ~14     !4, 4
         18        CONCAT                                           ~15     ~14, '%2C'
         19        FETCH_DIM_R                                      ~16     !4, 0
         20        CONCAT                                           ~17     ~15, ~16
         21        CONCAT                                           ~18     ~17, '%2C'
         22        FETCH_DIM_R                                      ~19     !4, 2
         23        CONCAT                                           ~20     ~18, ~19
         24        CONCAT                                           ~21     ~20, '%2C'
         25        FETCH_DIM_R                                      ~22     !4, 6
         26        CONCAT                                           ~23     ~21, ~22
         27        ASSIGN                                                   !2, ~23
   12    28        FETCH_DIM_R                                      ~25     !4, 4
         29        ASSIGN                                                   !1, ~25
    8    30    > > JMP                                                      ->8
         31    >   FE_FREE                                                  $9
   16    32        ECHO                                                     !2
   17    33      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
167.04 ms | 1396 KiB | 15 Q